Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subnet Container list still returns SubnetOperations and not Subnet #5584 #19109

Merged
merged 8 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<PackageId>Azure.ResourceManager.Authorization</PackageId>
<Description>Azure Resource Manager client SDK for Azure resource provider Microsoft.Authorization</Description>
<PackageTags>azure;management;arm;resource manager;authorization</PackageTags>
<IncludeGeneratorSharedCode>true</IncludeGeneratorSharedCode>
</PropertyGroup>

<PropertyGroup>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<EmbeddedResource Remove="Azure.ResourceManager.Authorization\**" />
<None Remove="Azure.ResourceManager.Authorization\**" />
</ItemGroup>

bquantump marked this conversation as resolved.
Show resolved Hide resolved
<ItemGroup>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
Expand Down
8 changes: 4 additions & 4 deletions sdk/resourcemanager/Proto.Client/network/SubnetContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ public SubnetBuilder Construct(string subnetCidr, NetworkSecurityGroupData group
/// </summary>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="P:System.Threading.CancellationToken.None" />. </param>
/// <returns> A collection of resource operations that may take multiple service requests to iterate over. </returns>
public Pageable<SubnetOperations> List(CancellationToken cancellationToken = default)
public Pageable<Subnet> List(CancellationToken cancellationToken = default)
{
return new PhWrappingPageable<Azure.ResourceManager.Network.Models.Subnet, SubnetOperations>(
return new PhWrappingPageable<Azure.ResourceManager.Network.Models.Subnet, Subnet>(
Operations.List(Id.ResourceGroup, Id.Name, cancellationToken),
convertor());
}
Expand All @@ -102,9 +102,9 @@ public Pageable<SubnetOperations> List(CancellationToken cancellationToken = def
/// </summary>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="P:System.Threading.CancellationToken.None" />. </param>
/// <returns> An async collection of resource operations that may take multiple service requests to iterate over. </returns>
public AsyncPageable<SubnetOperations> ListAsync(CancellationToken cancellationToken = default)
public AsyncPageable<Subnet> ListAsync(CancellationToken cancellationToken = default)
{
return new PhWrappingAsyncPageable<Azure.ResourceManager.Network.Models.Subnet, SubnetOperations>(
return new PhWrappingAsyncPageable<Azure.ResourceManager.Network.Models.Subnet, Subnet>(
Operations.ListAsync(Id.ResourceGroup, Id.Name, cancellationToken),
convertor());
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/resourcemanager/Proto.Client/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ static void Main(string[] args)
Scenario scenario = null;
try
{
scenario = ScenarioFactory.GetScenario(Scenarios.CreateSingleVmExample);
scenario = ScenarioFactory.GetScenario(Scenarios.GetByContainersAsync);
scenario.Execute();
}
finally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ private async Task ExecuteAsync()
Debug.Assert(virtualNetwork.Value.Data.Name.Equals(response.Data.Id.Name));
await foreach (var subnetResponse in response.GetSubnetContainer().ListAsync())
{
var actualSubnet = await subnetResponse.GetAsync();
var subnets = await response.GetSubnetContainer().GetAsync(actualSubnet.Value.Data.Name);
Debug.Assert(subnets.Value.Data.Name.Equals(actualSubnet.Value.Data.Name));
var subnets = await response.GetSubnetContainer().GetAsync(subnetResponse.Data.Name);
Debug.Assert(subnets.Value.Data.Name.Equals(subnetResponse.Data.Name));
}
}
Console.WriteLine("\nDone all asserts passed ...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ public override void Execute()
Debug.Assert(virtualNetwork.Value.Data.Name.Equals(response.Data.Id.Name));
foreach (var subnetResponse in response.GetSubnetContainer().List())
{
var actualSubnet = subnetResponse.Get();
var subnets = response.GetSubnetContainer().Get(actualSubnet.Value.Data.Name);
Debug.Assert(subnets.Value.Data.Name.Equals(actualSubnet.Value.Data.Name));
var subnets = response.GetSubnetContainer().Get(subnetResponse.Data.Name);
Debug.Assert(subnets.Value.Data.Name.Equals(subnetResponse.Data.Name));
}
}
Console.WriteLine("\nDone all asserts passed ...");
Expand Down