diff --git a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.net8.0.cs b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.net8.0.cs index 5e65bb9590e2..f6e752269361 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.net8.0.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.net8.0.cs @@ -6265,23 +6265,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.Compute.Models.GetVirtualMachineExpandType left, Azure.ResourceManager.Compute.Models.GetVirtualMachineExpandType right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct GetVirtualMachineImagesWithPropertiesExpand : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public GetVirtualMachineImagesWithPropertiesExpand(string value) { throw null; } - public static Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand Properties { get { throw null; } } - public bool Equals(Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand left, Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand right) { throw null; } - public static implicit operator Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand left, Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand right) { throw null; } - public override string ToString() { throw null; } - } public partial class GrantAccessData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GrantAccessData(Azure.ResourceManager.Compute.Models.AccessLevel access, int durationInSeconds) { } @@ -8496,8 +8479,8 @@ public SubscriptionResourceGetVirtualMachineImagesOptions(Azure.Core.AzureLocati } public partial class SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions { - public SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions(Azure.Core.AzureLocation location, string publisherName, string offer, string skus, Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand expand) { } - public Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand Expand { get { throw null; } } + public SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions(Azure.Core.AzureLocation location, string publisherName, string offer, string skus, string expand) { } + public string Expand { get { throw null; } } public Azure.Core.AzureLocation Location { get { throw null; } } public string Offer { get { throw null; } } public string Orderby { get { throw null; } set { } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs index 5e65bb9590e2..f6e752269361 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs @@ -6265,23 +6265,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.Compute.Models.GetVirtualMachineExpandType left, Azure.ResourceManager.Compute.Models.GetVirtualMachineExpandType right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct GetVirtualMachineImagesWithPropertiesExpand : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public GetVirtualMachineImagesWithPropertiesExpand(string value) { throw null; } - public static Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand Properties { get { throw null; } } - public bool Equals(Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand left, Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand right) { throw null; } - public static implicit operator Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand left, Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand right) { throw null; } - public override string ToString() { throw null; } - } public partial class GrantAccessData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GrantAccessData(Azure.ResourceManager.Compute.Models.AccessLevel access, int durationInSeconds) { } @@ -8496,8 +8479,8 @@ public SubscriptionResourceGetVirtualMachineImagesOptions(Azure.Core.AzureLocati } public partial class SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions { - public SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions(Azure.Core.AzureLocation location, string publisherName, string offer, string skus, Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand expand) { } - public Azure.ResourceManager.Compute.Models.GetVirtualMachineImagesWithPropertiesExpand Expand { get { throw null; } } + public SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions(Azure.Core.AzureLocation location, string publisherName, string offer, string skus, string expand) { } + public string Expand { get { throw null; } } public Azure.Core.AzureLocation Location { get { throw null; } } public string Offer { get { throw null; } } public string Orderby { get { throw null; } set { } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 44995731759c..fb1c0abaea18 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -464,7 +464,7 @@ public async Task GetVirtualMachineImagesWithProperties_VirtualMachineImagesList string publisherName = "MicrosoftWindowsServer"; string offer = "WindowsServer"; string skus = "2022-datacenter-azure-edition"; - GetVirtualMachineImagesWithPropertiesExpand expand = GetVirtualMachineImagesWithPropertiesExpand.Properties; + string expand = "Properties"; SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions options = new SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions(location, publisherName, offer, skus, expand) { Top = 4, Orderby = "aa" }; await foreach (VirtualMachineImage item in subscriptionResource.GetVirtualMachineImagesWithPropertiesAsync(options)) { @@ -497,7 +497,7 @@ public async Task GetVirtualMachineImagesWithProperties_VirtualMachineImagesList string publisherName = "MicrosoftWindowsServer"; string offer = "WindowsServer"; string skus = "2022-datacenter-azure-edition"; - GetVirtualMachineImagesWithPropertiesExpand expand = GetVirtualMachineImagesWithPropertiesExpand.Properties; + string expand = "Properties"; SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions options = new SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions(location, publisherName, offer, skus, expand); await foreach (VirtualMachineImage item in subscriptionResource.GetVirtualMachineImagesWithPropertiesAsync(options)) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs index 759e0bb02262..6360f2ecd32c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs @@ -1023,8 +1023,7 @@ public virtual AsyncPageable GetVirtualMachineImagesWithPro Argument.AssertNotNull(options, nameof(options)); HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListWithPropertiesRequest(Id.SubscriptionId, options.Location, options.PublisherName, options.Offer, options.Skus, options.Expand, options.Top, options.Orderby); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineImagesRestClient.CreateListWithPropertiesNextPageRequest(nextLink, Id.SubscriptionId, options.Location, options.PublisherName, options.Offer, options.Skus, options.Expand, options.Top, options.Orderby); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => VirtualMachineImage.DeserializeVirtualMachineImage(e), VirtualMachineImagesClientDiagnostics, Pipeline, "MockableComputeSubscriptionResource.GetVirtualMachineImagesWithProperties", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => VirtualMachineImage.DeserializeVirtualMachineImage(e), VirtualMachineImagesClientDiagnostics, Pipeline, "MockableComputeSubscriptionResource.GetVirtualMachineImagesWithProperties", "", null, cancellationToken); } /// @@ -1052,8 +1051,7 @@ public virtual Pageable GetVirtualMachineImagesWithProperti Argument.AssertNotNull(options, nameof(options)); HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListWithPropertiesRequest(Id.SubscriptionId, options.Location, options.PublisherName, options.Offer, options.Skus, options.Expand, options.Top, options.Orderby); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineImagesRestClient.CreateListWithPropertiesNextPageRequest(nextLink, Id.SubscriptionId, options.Location, options.PublisherName, options.Offer, options.Skus, options.Expand, options.Top, options.Orderby); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => VirtualMachineImage.DeserializeVirtualMachineImage(e), VirtualMachineImagesClientDiagnostics, Pipeline, "MockableComputeSubscriptionResource.GetVirtualMachineImagesWithProperties", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => VirtualMachineImage.DeserializeVirtualMachineImage(e), VirtualMachineImagesClientDiagnostics, Pipeline, "MockableComputeSubscriptionResource.GetVirtualMachineImagesWithProperties", "", null, cancellationToken); } /// diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GetVirtualMachineImagesWithPropertiesExpand.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GetVirtualMachineImagesWithPropertiesExpand.cs deleted file mode 100644 index fcdfd00941a2..000000000000 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/GetVirtualMachineImagesWithPropertiesExpand.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Compute.Models -{ - /// The GetVirtualMachineImagesWithPropertiesExpand. - public readonly partial struct GetVirtualMachineImagesWithPropertiesExpand : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GetVirtualMachineImagesWithPropertiesExpand(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PropertiesValue = "Properties"; - - /// Properties. - public static GetVirtualMachineImagesWithPropertiesExpand Properties { get; } = new GetVirtualMachineImagesWithPropertiesExpand(PropertiesValue); - /// Determines if two values are the same. - public static bool operator ==(GetVirtualMachineImagesWithPropertiesExpand left, GetVirtualMachineImagesWithPropertiesExpand right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GetVirtualMachineImagesWithPropertiesExpand left, GetVirtualMachineImagesWithPropertiesExpand right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator GetVirtualMachineImagesWithPropertiesExpand(string value) => new GetVirtualMachineImagesWithPropertiesExpand(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GetVirtualMachineImagesWithPropertiesExpand other && Equals(other); - /// - public bool Equals(GetVirtualMachineImagesWithPropertiesExpand other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions.cs index 1068e8389f6c..9ddcc3eeae4f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions.cs @@ -19,12 +19,13 @@ public partial class SubscriptionResourceGetVirtualMachineImagesWithPropertiesOp /// A valid image publisher offer. /// A valid image SKU. /// The expand expression to apply on the operation. - /// , or is null. - public SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions(AzureLocation location, string publisherName, string offer, string skus, GetVirtualMachineImagesWithPropertiesExpand expand) + /// , , or is null. + public SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions(AzureLocation location, string publisherName, string offer, string skus, string expand) { Argument.AssertNotNull(publisherName, nameof(publisherName)); Argument.AssertNotNull(offer, nameof(offer)); Argument.AssertNotNull(skus, nameof(skus)); + Argument.AssertNotNull(expand, nameof(expand)); Location = location; PublisherName = publisherName; @@ -47,7 +48,7 @@ internal SubscriptionResourceGetVirtualMachineImagesWithPropertiesOptions() /// A valid image SKU. public string Skus { get; } /// The expand expression to apply on the operation. - public GetVirtualMachineImagesWithPropertiesExpand Expand { get; } + public string Expand { get; } /// The top. public int? Top { get; set; } /// The orderby. diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineImagesWithPropertiesListResult.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineImagesWithPropertiesListResult.Serialization.cs deleted file mode 100644 index 1457376ea15e..000000000000 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineImagesWithPropertiesListResult.Serialization.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Compute.Models -{ - internal partial class VirtualMachineImagesWithPropertiesListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(VirtualMachineImagesWithPropertiesListResult)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - VirtualMachineImagesWithPropertiesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(VirtualMachineImagesWithPropertiesListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeVirtualMachineImagesWithPropertiesListResult(document.RootElement, options); - } - - internal static VirtualMachineImagesWithPropertiesListResult DeserializeVirtualMachineImagesWithPropertiesListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(VirtualMachineImage.DeserializeVirtualMachineImage(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new VirtualMachineImagesWithPropertiesListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(VirtualMachineImagesWithPropertiesListResult)} does not support writing '{options.Format}' format."); - } - } - - VirtualMachineImagesWithPropertiesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeVirtualMachineImagesWithPropertiesListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(VirtualMachineImagesWithPropertiesListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineImagesWithPropertiesListResult.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineImagesWithPropertiesListResult.cs deleted file mode 100644 index 46d2a92a0fe1..000000000000 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineImagesWithPropertiesListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.Compute.Models -{ - /// The List Virtual Machine Images operation response. - internal partial class VirtualMachineImagesWithPropertiesListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal VirtualMachineImagesWithPropertiesListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The list of virtual machine images. - /// The URI to fetch the next page of virtual machine images. Call ListNext() with this URI to fetch the next page of virtual machine images. - /// Keeps track of any properties unknown to the library. - internal VirtualMachineImagesWithPropertiesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The list of virtual machine images. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page of virtual machine images. Call ListNext() with this URI to fetch the next page of virtual machine images. - public string NextLink { get; } - } -} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs index c1b2ebe4038a..76e61d9c03d6 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs @@ -697,7 +697,7 @@ public Response ListByEdgeZone(string subscription } } - internal RequestUriBuilder CreateListWithPropertiesRequestUri(string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, GetVirtualMachineImagesWithPropertiesExpand expand, int? top, string orderby) + internal RequestUriBuilder CreateListWithPropertiesRequestUri(string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, string expand, int? top, string orderby) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -712,7 +712,7 @@ internal RequestUriBuilder CreateListWithPropertiesRequestUri(string subscriptio uri.AppendPath("/skus/", false); uri.AppendPath(skus, true); uri.AppendPath("/versions", false); - uri.AppendQuery("$expand", expand.ToString(), true); + uri.AppendQuery("$expand", expand, true); if (top != null) { uri.AppendQuery("$top", top.Value, true); @@ -725,7 +725,7 @@ internal RequestUriBuilder CreateListWithPropertiesRequestUri(string subscriptio return uri; } - internal HttpMessage CreateListWithPropertiesRequest(string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, GetVirtualMachineImagesWithPropertiesExpand expand, int? top, string orderby) + internal HttpMessage CreateListWithPropertiesRequest(string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, string expand, int? top, string orderby) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -743,7 +743,7 @@ internal HttpMessage CreateListWithPropertiesRequest(string subscriptionId, Azur uri.AppendPath("/skus/", false); uri.AppendPath(skus, true); uri.AppendPath("/versions", false); - uri.AppendQuery("$expand", expand.ToString(), true); + uri.AppendQuery("$expand", expand, true); if (top != null) { uri.AppendQuery("$top", top.Value, true); @@ -768,14 +768,15 @@ internal HttpMessage CreateListWithPropertiesRequest(string subscriptionId, Azur /// The ? to use. /// The to use. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListWithPropertiesAsync(string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, GetVirtualMachineImagesWithPropertiesExpand expand, int? top = null, string orderby = null, CancellationToken cancellationToken = default) + public async Task>> ListWithPropertiesAsync(string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, string expand, int? top = null, string orderby = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); Argument.AssertNotNullOrEmpty(offer, nameof(offer)); Argument.AssertNotNullOrEmpty(skus, nameof(skus)); + Argument.AssertNotNull(expand, nameof(expand)); using var message = CreateListWithPropertiesRequest(subscriptionId, location, publisherName, offer, skus, expand, top, orderby); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); @@ -783,9 +784,14 @@ public async Task> ListWi { case 200: { - VirtualMachineImagesWithPropertiesListResult value = default; + IReadOnlyList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = VirtualMachineImagesWithPropertiesListResult.DeserializeVirtualMachineImagesWithPropertiesListResult(document.RootElement); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VirtualMachineImage.DeserializeVirtualMachineImage(item)); + } + value = array; return Response.FromValue(value, message.Response); } default: @@ -802,14 +808,15 @@ public async Task> ListWi /// The ? to use. /// The to use. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListWithProperties(string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, GetVirtualMachineImagesWithPropertiesExpand expand, int? top = null, string orderby = null, CancellationToken cancellationToken = default) + public Response> ListWithProperties(string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, string expand, int? top = null, string orderby = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); Argument.AssertNotNullOrEmpty(offer, nameof(offer)); Argument.AssertNotNullOrEmpty(skus, nameof(skus)); + Argument.AssertNotNull(expand, nameof(expand)); using var message = CreateListWithPropertiesRequest(subscriptionId, location, publisherName, offer, skus, expand, top, orderby); _pipeline.Send(message, cancellationToken); @@ -817,103 +824,14 @@ public Response ListWithProperties { case 200: { - VirtualMachineImagesWithPropertiesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = VirtualMachineImagesWithPropertiesListResult.DeserializeVirtualMachineImagesWithPropertiesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListWithPropertiesNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, GetVirtualMachineImagesWithPropertiesExpand expand, int? top, string orderby) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListWithPropertiesNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, GetVirtualMachineImagesWithPropertiesExpand expand, int? top, string orderby) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of a supported Azure region. - /// A valid image publisher. - /// A valid image publisher offer. - /// A valid image SKU. - /// The expand expression to apply on the operation. - /// The ? to use. - /// The to use. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListWithPropertiesNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, GetVirtualMachineImagesWithPropertiesExpand expand, int? top = null, string orderby = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - Argument.AssertNotNullOrEmpty(offer, nameof(offer)); - Argument.AssertNotNullOrEmpty(skus, nameof(skus)); - - using var message = CreateListWithPropertiesNextPageRequest(nextLink, subscriptionId, location, publisherName, offer, skus, expand, top, orderby); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VirtualMachineImagesWithPropertiesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = VirtualMachineImagesWithPropertiesListResult.DeserializeVirtualMachineImagesWithPropertiesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of a supported Azure region. - /// A valid image publisher. - /// A valid image publisher offer. - /// A valid image SKU. - /// The expand expression to apply on the operation. - /// The ? to use. - /// The to use. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListWithPropertiesNextPage(string nextLink, string subscriptionId, AzureLocation location, string publisherName, string offer, string skus, GetVirtualMachineImagesWithPropertiesExpand expand, int? top = null, string orderby = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - Argument.AssertNotNullOrEmpty(offer, nameof(offer)); - Argument.AssertNotNullOrEmpty(skus, nameof(skus)); - - using var message = CreateListWithPropertiesNextPageRequest(nextLink, subscriptionId, location, publisherName, offer, skus, expand, top, orderby); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VirtualMachineImagesWithPropertiesListResult value = default; + IReadOnlyList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = VirtualMachineImagesWithPropertiesListResult.DeserializeVirtualMachineImagesWithPropertiesListResult(document.RootElement); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VirtualMachineImage.DeserializeVirtualMachineImage(item)); + } + value = array; return Response.FromValue(value, message.Response); } default: diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md b/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md index 891b2449b699..6aa8c72fb2d2 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md +++ b/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md @@ -10,7 +10,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: Compute namespace: Azure.ResourceManager.Compute -require: https://github.com/Azure/azure-rest-api-specs/blob/883abbe08d313739069c0007eb820aa0a0710748/specification/compute/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/compute/resource-manager/readme.md #tag: package-2025-02-01 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/