Skip to content

Commit f9aaf39

Browse files
update Azure.ResourceManager.Compute (#53863)
1 parent f6c5f85 commit f9aaf39

File tree

54 files changed

+2485
-643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2485
-643
lines changed

sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
- Added `InstantAccess` property to `RestorePointGroupPatch` class.
1010
- Added `InstantAccessDurationMinutes` property to `RestorePointData` class.
1111
- Added `EnableFips1403Encryption` property to `AdditionalCapabilities` class.
12+
- Modified `DiskIOPSReadWrite` and `DiskMBpsReadWrite` properties under the `VirtualMachineDataDisk` class to make the properties writable, and expanded the scope of usage from only VMSS to also include Virtual Machines and Flexible VMs.
1213

1314
### Breaking Changes
1415

15-
Modified `DiskIOPSReadWrite` and `DiskMBpsReadWrite` properties under the `VirtualMachineDataDisk` class to make the properties writable, and expanded the scope of usage from only VMSS to also include Virtual Machines and Flexible VMs.
16+
- `CommunityGallery`, `CommunityGalleryImage`, `CommunityGalleryImageVersion` are no longer ARM resources in the library, their corresponding `*Resource` and `*Collection` classes are now hidden. Please use related methods added in `ComputeExtensions` class instead.
17+
- `SharedGallery`, `SharedGalleryImage`, `SharedGalleryImageVersion` are no longer ARM resources in the library, their corresponding `*Resource` and `*Collection` classes are now hidden. Please use related methods added in `ComputeExtensions` class instead.
1618

1719
## 1.12.0 (2025-09-26)
1820

@@ -51,7 +53,7 @@ Modified `DiskIOPSReadWrite` and `DiskMBpsReadWrite` properties under the `Virtu
5153

5254
### Breaking Changes
5355

54-
- Removed `GetVirtualMachineImagesWithPropertiesExpand` class as it has no utility.
56+
- Removed `GetVirtualMachineImagesWithPropertiesExpand` class as it has no utility.
5557

5658
## 1.10.0 (2025-06-30)
5759

sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.net8.0.cs

Lines changed: 70 additions & 0 deletions
Large diffs are not rendered by default.

sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs

Lines changed: 70 additions & 0 deletions
Large diffs are not rendered by default.

sdk/compute/Azure.ResourceManager.Compute/src/Generated/CommunityGalleryCollection.cs renamed to sdk/compute/Azure.ResourceManager.Compute/src/Customize/CommunityGalleryCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
// <auto-generated/>
5-
64
#nullable disable
75

86
using System;
7+
using System.ComponentModel;
98
using System.Globalization;
109
using System.Threading;
1110
using System.Threading.Tasks;
@@ -20,6 +19,7 @@ namespace Azure.ResourceManager.Compute
2019
/// Each <see cref="CommunityGalleryResource"/> in the collection will belong to the same instance of <see cref="SubscriptionResource"/>.
2120
/// To get a <see cref="CommunityGalleryCollection"/> instance call the GetCommunityGalleries method from an instance of <see cref="SubscriptionResource"/>.
2221
/// </summary>
22+
[EditorBrowsable(EditorBrowsableState.Never)]
2323
public partial class CommunityGalleryCollection : ArmCollection
2424
{
2525
private readonly ClientDiagnostics _communityGalleryClientDiagnostics;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System.ComponentModel;
7+
using Azure.Core;
8+
9+
namespace Azure.ResourceManager.Compute
10+
{
11+
// we have this customization here to change its namespace to avoid breaking changes
12+
[CodeGenType("CommunityGalleryData")]
13+
public partial class CommunityGalleryData
14+
{
15+
// we also must add back this property to avoid breaking changes, but its payload never have this property.
16+
/// <summary>
17+
/// The resource identifier.
18+
///
19+
/// This property is depracated and will be removed in a future release.
20+
/// There is possibility that this property will be null.
21+
/// </summary>
22+
[EditorBrowsable(EditorBrowsableState.Never)]
23+
public ResourceIdentifier Id { get; internal set; }
24+
}
25+
}
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
// <auto-generated/>
5-
64
#nullable disable
75

86
using System;
97
using System.Collections;
108
using System.Collections.Generic;
9+
using System.ComponentModel;
1110
using System.Globalization;
11+
using System.Text.Json;
1212
using System.Threading;
1313
using System.Threading.Tasks;
1414
using Autorest.CSharp.Core;
@@ -22,6 +22,7 @@ namespace Azure.ResourceManager.Compute
2222
/// Each <see cref="CommunityGalleryImageResource"/> in the collection will belong to the same instance of <see cref="CommunityGalleryResource"/>.
2323
/// To get a <see cref="CommunityGalleryImageCollection"/> instance call the GetCommunityGalleryImages method from an instance of <see cref="CommunityGalleryResource"/>.
2424
/// </summary>
25+
[EditorBrowsable(EditorBrowsableState.Never)]
2526
public partial class CommunityGalleryImageCollection : ArmCollection, IEnumerable<CommunityGalleryImageResource>, IAsyncEnumerable<CommunityGalleryImageResource>
2627
{
2728
private readonly ClientDiagnostics _communityGalleryImageClientDiagnostics;
@@ -170,7 +171,7 @@ public virtual AsyncPageable<CommunityGalleryImageResource> GetAllAsync(Cancella
170171
{
171172
HttpMessage FirstPageRequest(int? pageSizeHint) => _communityGalleryImageRestClient.CreateListRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name);
172173
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _communityGalleryImageRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name);
173-
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CommunityGalleryImageResource(Client, CommunityGalleryImageData.DeserializeCommunityGalleryImageData(e)), _communityGalleryImageClientDiagnostics, Pipeline, "CommunityGalleryImageCollection.GetAll", "value", "nextLink", cancellationToken);
174+
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CommunityGalleryImageResource(Client, DeserializeCommunityGalleryImageData(e)), _communityGalleryImageClientDiagnostics, Pipeline, "CommunityGalleryImageCollection.GetAll", "value", "nextLink", cancellationToken);
174175
}
175176

176177
/// <summary>
@@ -200,7 +201,14 @@ public virtual Pageable<CommunityGalleryImageResource> GetAll(CancellationToken
200201
{
201202
HttpMessage FirstPageRequest(int? pageSizeHint) => _communityGalleryImageRestClient.CreateListRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name);
202203
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _communityGalleryImageRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name);
203-
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CommunityGalleryImageResource(Client, CommunityGalleryImageData.DeserializeCommunityGalleryImageData(e)), _communityGalleryImageClientDiagnostics, Pipeline, "CommunityGalleryImageCollection.GetAll", "value", "nextLink", cancellationToken);
204+
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CommunityGalleryImageResource(Client, DeserializeCommunityGalleryImageData(e)), _communityGalleryImageClientDiagnostics, Pipeline, "CommunityGalleryImageCollection.GetAll", "value", "nextLink", cancellationToken);
205+
}
206+
207+
private CommunityGalleryImageData DeserializeCommunityGalleryImageData(JsonElement element)
208+
{
209+
var data = CommunityGalleryImageData.DeserializeCommunityGalleryImageData(element);
210+
data.Id = CommunityGalleryImageResource.CreateResourceIdentifier(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, data.Name);
211+
return data;
204212
}
205213

206214
/// <summary>

sdk/compute/Azure.ResourceManager.Compute/src/Customize/CommunityGalleryImageData.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
#nullable disable
55

66
using System.ComponentModel;
7+
using Azure.Core;
78
using Azure.ResourceManager.Compute.Models;
89

910
namespace Azure.ResourceManager.Compute
1011
{
12+
// we have this customization here to change its namespace to avoid breaking changes
13+
[CodeGenType("CommunityGalleryImageData")]
1114
public partial class CommunityGalleryImageData
1215
{
1316
/// <summary> This is the gallery image definition identifier. </summary>
@@ -18,5 +21,15 @@ public partial class CommunityGalleryImageData
1821
Offer = ImageIdentifier.Offer,
1922
Sku = ImageIdentifier.Sku
2023
};
24+
25+
// we also must add back this property to avoid breaking changes, but its payload never have this property.
26+
/// <summary>
27+
/// The resource identifier.
28+
///
29+
/// This property is depracated and will be removed in a future release.
30+
/// There is possibility that this property will be null.
31+
/// </summary>
32+
[EditorBrowsable(EditorBrowsableState.Never)]
33+
public ResourceIdentifier Id { get; internal set; }
2134
}
2235
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
// <auto-generated/>
5-
64
#nullable disable
75

86
using System;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
// <auto-generated/>
5-
64
#nullable disable
75

86
using System;
7+
using System.ComponentModel;
98
using System.Globalization;
109
using System.Threading;
1110
using System.Threading.Tasks;
@@ -20,6 +19,7 @@ namespace Azure.ResourceManager.Compute
2019
/// from an instance of <see cref="ArmClient"/> using the GetCommunityGalleryImageResource method.
2120
/// Otherwise you can get one from its parent resource <see cref="CommunityGalleryResource"/> using the GetCommunityGalleryImage method.
2221
/// </summary>
22+
[EditorBrowsable(EditorBrowsableState.Never)]
2323
public partial class CommunityGalleryImageResource : ArmResource
2424
{
2525
/// <summary> Generate the resource identifier of a <see cref="CommunityGalleryImageResource"/> instance. </summary>
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
// <auto-generated/>
5-
64
#nullable disable
75

86
using System;
97
using System.Collections;
108
using System.Collections.Generic;
9+
using System.ComponentModel;
1110
using System.Globalization;
11+
using System.Text.Json;
1212
using System.Threading;
1313
using System.Threading.Tasks;
1414
using Autorest.CSharp.Core;
@@ -22,6 +22,7 @@ namespace Azure.ResourceManager.Compute
2222
/// Each <see cref="CommunityGalleryImageVersionResource"/> in the collection will belong to the same instance of <see cref="CommunityGalleryImageResource"/>.
2323
/// To get a <see cref="CommunityGalleryImageVersionCollection"/> instance call the GetCommunityGalleryImageVersions method from an instance of <see cref="CommunityGalleryImageResource"/>.
2424
/// </summary>
25+
[EditorBrowsable(EditorBrowsableState.Never)]
2526
public partial class CommunityGalleryImageVersionCollection : ArmCollection, IEnumerable<CommunityGalleryImageVersionResource>, IAsyncEnumerable<CommunityGalleryImageVersionResource>
2627
{
2728
private readonly ClientDiagnostics _communityGalleryImageVersionClientDiagnostics;
@@ -170,7 +171,7 @@ public virtual AsyncPageable<CommunityGalleryImageVersionResource> GetAllAsync(C
170171
{
171172
HttpMessage FirstPageRequest(int? pageSizeHint) => _communityGalleryImageVersionRestClient.CreateListRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name);
172173
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _communityGalleryImageVersionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name);
173-
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CommunityGalleryImageVersionResource(Client, CommunityGalleryImageVersionData.DeserializeCommunityGalleryImageVersionData(e)), _communityGalleryImageVersionClientDiagnostics, Pipeline, "CommunityGalleryImageVersionCollection.GetAll", "value", "nextLink", cancellationToken);
174+
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CommunityGalleryImageVersionResource(Client, DeserializeCommunityGalleryImageVersionData(e)), _communityGalleryImageVersionClientDiagnostics, Pipeline, "CommunityGalleryImageVersionCollection.GetAll", "value", "nextLink", cancellationToken);
174175
}
175176

176177
/// <summary>
@@ -200,7 +201,14 @@ public virtual Pageable<CommunityGalleryImageVersionResource> GetAll(Cancellatio
200201
{
201202
HttpMessage FirstPageRequest(int? pageSizeHint) => _communityGalleryImageVersionRestClient.CreateListRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name);
202203
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _communityGalleryImageVersionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name);
203-
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CommunityGalleryImageVersionResource(Client, CommunityGalleryImageVersionData.DeserializeCommunityGalleryImageVersionData(e)), _communityGalleryImageVersionClientDiagnostics, Pipeline, "CommunityGalleryImageVersionCollection.GetAll", "value", "nextLink", cancellationToken);
204+
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CommunityGalleryImageVersionResource(Client, DeserializeCommunityGalleryImageVersionData(e)), _communityGalleryImageVersionClientDiagnostics, Pipeline, "CommunityGalleryImageVersionCollection.GetAll", "value", "nextLink", cancellationToken);
205+
}
206+
207+
private CommunityGalleryImageVersionData DeserializeCommunityGalleryImageVersionData(JsonElement element)
208+
{
209+
var data = CommunityGalleryImageVersionData.DeserializeCommunityGalleryImageVersionData(element);
210+
data.Id = CommunityGalleryImageVersionResource.CreateResourceIdentifier(Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, data.Name);
211+
return data;
204212
}
205213

206214
/// <summary>

0 commit comments

Comments
 (0)