Skip to content

Commit 4c1db94

Browse files
Resolve remaining issues in azure.resourcemanager.compute (Azure#29761)
* update * fix * use extendedlocationtype from resourcemanager to replace the one defined in Compute * update
1 parent 4df9dd1 commit 4c1db94

13 files changed

+156947
-159
lines changed

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

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ public static partial class ComputeExtensions
506506
public static Azure.ResourceManager.Compute.CommunityGalleryImageVersionResource GetCommunityGalleryImageVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; }
507507
public static Azure.ResourceManager.Compute.CommunityGalleryResource GetCommunityGalleryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; }
508508
public static Azure.ResourceManager.Compute.ComputePrivateEndpointConnectionResource GetComputePrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; }
509+
public static Azure.Pageable<Azure.ResourceManager.Compute.Models.ComputeResourceSku> GetComputeResourceSkus(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string includeExtendedLocations = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
510+
public static Azure.AsyncPageable<Azure.ResourceManager.Compute.Models.ComputeResourceSku> GetComputeResourceSkusAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string includeExtendedLocations = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
509511
public static Azure.Response<Azure.ResourceManager.Compute.DedicatedHostGroupResource> GetDedicatedHostGroup(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string hostGroupName, Azure.ResourceManager.Compute.Models.InstanceViewType? expand = default(Azure.ResourceManager.Compute.Models.InstanceViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
510512
public static System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Compute.DedicatedHostGroupResource>> GetDedicatedHostGroupAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string hostGroupName, Azure.ResourceManager.Compute.Models.InstanceViewType? expand = default(Azure.ResourceManager.Compute.Models.InstanceViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
511513
public static Azure.ResourceManager.Compute.DedicatedHostGroupResource GetDedicatedHostGroupResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; }
@@ -558,8 +560,6 @@ public static partial class ComputeExtensions
558560
public static Azure.AsyncPageable<Azure.ResourceManager.Compute.ProximityPlacementGroupResource> GetProximityPlacementGroupsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
559561
public static Azure.Pageable<Azure.ResourceManager.Compute.Models.VirtualMachineImageBase> GetPublishersVirtualMachineImagesEdgeZones(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string edgeZone, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
560562
public static Azure.AsyncPageable<Azure.ResourceManager.Compute.Models.VirtualMachineImageBase> GetPublishersVirtualMachineImagesEdgeZonesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string edgeZone, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
561-
public static Azure.Pageable<Azure.ResourceManager.Compute.Models.ComputeResourceSku> GetResourceSkus(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string includeExtendedLocations = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
562-
public static Azure.AsyncPageable<Azure.ResourceManager.Compute.Models.ComputeResourceSku> GetResourceSkusAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string includeExtendedLocations = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
563563
public static Azure.Response<Azure.ResourceManager.Compute.RestorePointGroupResource> GetRestorePointGroup(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string restorePointGroupName, Azure.ResourceManager.Compute.Models.RestorePointGroupExpand? expand = default(Azure.ResourceManager.Compute.Models.RestorePointGroupExpand?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
564564
public static System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Compute.RestorePointGroupResource>> GetRestorePointGroupAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string restorePointGroupName, Azure.ResourceManager.Compute.Models.RestorePointGroupExpand? expand = default(Azure.ResourceManager.Compute.Models.RestorePointGroupExpand?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
565565
public static Azure.ResourceManager.Compute.RestorePointGroupResource GetRestorePointGroupResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; }
@@ -2783,7 +2783,7 @@ public partial class ComputeResourceSkuLocationInfo
27832783
{
27842784
internal ComputeResourceSkuLocationInfo() { }
27852785
public System.Collections.Generic.IReadOnlyList<string> ExtendedLocations { get { throw null; } }
2786-
public Azure.ResourceManager.Compute.Models.ExtendedLocationType? ExtendedLocationType { get { throw null; } }
2786+
public Azure.ResourceManager.Resources.Models.ExtendedLocationType? ExtendedLocationType { get { throw null; } }
27872787
public Azure.Core.AzureLocation? Location { get { throw null; } }
27882788
public System.Collections.Generic.IReadOnlyList<Azure.ResourceManager.Compute.Models.ComputeResourceSkuZoneDetails> ZoneDetails { get { throw null; } }
27892789
public System.Collections.Generic.IReadOnlyList<string> Zones { get { throw null; } }
@@ -3369,23 +3369,6 @@ public EncryptionSettingsGroup(bool enabled) { }
33693369
public static bool operator !=(Azure.ResourceManager.Compute.Models.ExecutionState left, Azure.ResourceManager.Compute.Models.ExecutionState right) { throw null; }
33703370
public override string ToString() { throw null; }
33713371
}
3372-
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
3373-
public readonly partial struct ExtendedLocationType : System.IEquatable<Azure.ResourceManager.Compute.Models.ExtendedLocationType>
3374-
{
3375-
private readonly object _dummy;
3376-
private readonly int _dummyPrimitive;
3377-
public ExtendedLocationType(string value) { throw null; }
3378-
public static Azure.ResourceManager.Compute.Models.ExtendedLocationType EdgeZone { get { throw null; } }
3379-
public bool Equals(Azure.ResourceManager.Compute.Models.ExtendedLocationType other) { throw null; }
3380-
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
3381-
public override bool Equals(object obj) { throw null; }
3382-
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
3383-
public override int GetHashCode() { throw null; }
3384-
public static bool operator ==(Azure.ResourceManager.Compute.Models.ExtendedLocationType left, Azure.ResourceManager.Compute.Models.ExtendedLocationType right) { throw null; }
3385-
public static implicit operator Azure.ResourceManager.Compute.Models.ExtendedLocationType (string value) { throw null; }
3386-
public static bool operator !=(Azure.ResourceManager.Compute.Models.ExtendedLocationType left, Azure.ResourceManager.Compute.Models.ExtendedLocationType right) { throw null; }
3387-
public override string ToString() { throw null; }
3388-
}
33893372
public partial class GalleryApplicationPatch : Azure.ResourceManager.Models.ResourceData
33903373
{
33913374
public GalleryApplicationPatch() { }
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System.Collections.Generic;
7+
using System.Text.Json;
8+
using Azure.Core;
9+
10+
namespace Azure.ResourceManager.Compute.Models
11+
{
12+
// TEMPORARY: this piece of customized code replaces the ExtendedLocationType with the one in resourcemanager
13+
public partial class ComputeResourceSkuLocationInfo
14+
{
15+
internal static ComputeResourceSkuLocationInfo DeserializeComputeResourceSkuLocationInfo(JsonElement element)
16+
{
17+
Optional<AzureLocation> location = default;
18+
Optional<IReadOnlyList<string>> zones = default;
19+
Optional<IReadOnlyList<ComputeResourceSkuZoneDetails>> zoneDetails = default;
20+
Optional<IReadOnlyList<string>> extendedLocations = default;
21+
Optional<Azure.ResourceManager.Resources.Models.ExtendedLocationType> type = default;
22+
foreach (var property in element.EnumerateObject())
23+
{
24+
if (property.NameEquals("location"))
25+
{
26+
if (property.Value.ValueKind == JsonValueKind.Null)
27+
{
28+
property.ThrowNonNullablePropertyIsNull();
29+
continue;
30+
}
31+
location = new AzureLocation(property.Value.GetString());
32+
continue;
33+
}
34+
if (property.NameEquals("zones"))
35+
{
36+
if (property.Value.ValueKind == JsonValueKind.Null)
37+
{
38+
property.ThrowNonNullablePropertyIsNull();
39+
continue;
40+
}
41+
List<string> array = new List<string>();
42+
foreach (var item in property.Value.EnumerateArray())
43+
{
44+
array.Add(item.GetString());
45+
}
46+
zones = array;
47+
continue;
48+
}
49+
if (property.NameEquals("zoneDetails"))
50+
{
51+
if (property.Value.ValueKind == JsonValueKind.Null)
52+
{
53+
property.ThrowNonNullablePropertyIsNull();
54+
continue;
55+
}
56+
List<ComputeResourceSkuZoneDetails> array = new List<ComputeResourceSkuZoneDetails>();
57+
foreach (var item in property.Value.EnumerateArray())
58+
{
59+
array.Add(ComputeResourceSkuZoneDetails.DeserializeComputeResourceSkuZoneDetails(item));
60+
}
61+
zoneDetails = array;
62+
continue;
63+
}
64+
if (property.NameEquals("extendedLocations"))
65+
{
66+
if (property.Value.ValueKind == JsonValueKind.Null)
67+
{
68+
property.ThrowNonNullablePropertyIsNull();
69+
continue;
70+
}
71+
List<string> array = new List<string>();
72+
foreach (var item in property.Value.EnumerateArray())
73+
{
74+
array.Add(item.GetString());
75+
}
76+
extendedLocations = array;
77+
continue;
78+
}
79+
if (property.NameEquals("type"))
80+
{
81+
if (property.Value.ValueKind == JsonValueKind.Null)
82+
{
83+
property.ThrowNonNullablePropertyIsNull();
84+
continue;
85+
}
86+
type = new Azure.ResourceManager.Resources.Models.ExtendedLocationType(property.Value.GetString());
87+
continue;
88+
}
89+
}
90+
return new ComputeResourceSkuLocationInfo(Optional.ToNullable(location), Optional.ToList(zones), Optional.ToList(zoneDetails), Optional.ToList(extendedLocations), Optional.ToNullable(type));
91+
}
92+
}
93+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using Azure.Core;
7+
8+
namespace Azure.ResourceManager.Compute.Models
9+
{
10+
// TEMPORARY: this piece of customized code replaces the ExtendedLocationType with the one in resourcemanager
11+
public partial class ComputeResourceSkuLocationInfo
12+
{
13+
/// <summary> The type of the extended location. </summary>
14+
[CodeGenMember("ExtendedLocationType")]
15+
public Azure.ResourceManager.Resources.Models.ExtendedLocationType? ExtendedLocationType { get; }
16+
}
17+
}

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

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;

sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)