Skip to content

Commit 0c810f4

Browse files
authored
MPG migration SDK - Consumption (Azure#55468)
1 parent 36d875f commit 0c810f4

342 files changed

Lines changed: 36424 additions & 21209 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# The Unknown* discriminator fallback type is an internal generator implementation detail.
2+
# Its name is captured in public PersistableModelProxyAttribute metadata, but the runtime
3+
# behavior is unchanged and the review recommendation is to baseline this metadata-only
4+
# change instead of adding SDK custom code.
5+
CannotChangeAttribute : Attribute 'System.ClientModel.Primitives.PersistableModelProxyAttribute' on 'Azure.ResourceManager.Consumption.Models.ConsumptionUsageDetail' changed from '[PersistableModelProxyAttribute(typeof(UnknownUsageDetail))]' in the contract to '[PersistableModelProxyAttribute(typeof(UnknownConsumptionUsageDetail))]' in the implementation.
6+
CannotChangeAttribute : Attribute 'System.ClientModel.Primitives.PersistableModelProxyAttribute' on 'Azure.ResourceManager.Consumption.Models.ConsumptionChargeSummary' changed from '[PersistableModelProxyAttribute(typeof(UnknownChargeSummary))]' in the contract to '[PersistableModelProxyAttribute(typeof(UnknownConsumptionChargeSummary))]' in the implementation.
7+
CannotChangeAttribute : Attribute 'System.ClientModel.Primitives.PersistableModelProxyAttribute' on 'Azure.ResourceManager.Consumption.Models.ConsumptionReservationRecommendation' changed from '[PersistableModelProxyAttribute(typeof(UnknownReservationRecommendation))]' in the contract to '[PersistableModelProxyAttribute(typeof(UnknownConsumptionReservationRecommendation))]' in the implementation.

sdk/consumption/Azure.ResourceManager.Consumption/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66

77
### Breaking Changes
88

9+
- Obsoleted `BillingAccountConsumptionResource`, `BillingCustomerConsumptionResource`, `BillingProfileConsumptionResource`, `ManagementGroupBillingPeriodConsumptionResource`, `ReservationConsumptionResource`, `ReservationOrderConsumptionResource`, `SubscriptionBillingPeriodConsumptionResource`, `TenantBillingPeriodConsumptionResource` as they are no longer supported in the TypeSpec-based SDK. The signatures are preserved for source/binary compatibility, but invoking any of their members now throws `NotSupportedException`. Use the corresponding extension methods on the parent scopes instead.
10+
- Obsoleted `ConsumptionCreditSummary` and `PriceSheetResult` types. The signatures are preserved for source/binary compatibility, but constructing them or invoking their members now throws `NotSupportedException`. Use `ConsumptionCreditSummaryData` and `PriceSheetResultData` instead.
11+
912
### Bugs Fixed
1013

1114
### Other Changes
1215

16+
- Migrated from AutoRest to TypeSpec-based code generation.
17+
1318
## 1.1.0 (2026-04-21)
1419

1520
### Other Changes

sdk/consumption/Azure.ResourceManager.Consumption/api/Azure.ResourceManager.Consumption.net10.0.cs

Lines changed: 611 additions & 17 deletions
Large diffs are not rendered by default.

sdk/consumption/Azure.ResourceManager.Consumption/api/Azure.ResourceManager.Consumption.net8.0.cs

Lines changed: 611 additions & 17 deletions
Large diffs are not rendered by default.

sdk/consumption/Azure.ResourceManager.Consumption/api/Azure.ResourceManager.Consumption.netstandard2.0.cs

Lines changed: 611 additions & 17 deletions
Large diffs are not rendered by default.

sdk/consumption/Azure.ResourceManager.Consumption/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "net",
44
"TagPrefix": "net/consumption/Azure.ResourceManager.Consumption",
5-
"Tag": "net/consumption/Azure.ResourceManager.Consumption_db13a04342"
5+
"Tag": "net/consumption/Azure.ResourceManager.Consumption_442644e4ea"
66
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"apiVersions": {
3+
"Microsoft.Consumption": "2024-08-01"
4+
}
5+
}

sdk/consumption/Azure.ResourceManager.Consumption/src/Azure.ResourceManager.Consumption.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
<Description>Microsoft Azure Resource Manager client SDK for Azure resource provider Microsoft.Consumption.</Description>
88
<PackageTags>azure;management;arm;resource manager;consumption</PackageTags>
99
<DisableEnhancedAnalysis>true</DisableEnhancedAnalysis>
10-
<IncludeAutorestDependency>true</IncludeAutorestDependency>
1110
</PropertyGroup>
1211
</Project>

sdk/consumption/Azure.ResourceManager.Consumption/src/Custom/ArmConsumptionModelFactory.cs

Lines changed: 141 additions & 30 deletions
Large diffs are not rendered by default.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System;
7+
using System.ComponentModel;
8+
using System.Threading;
9+
using System.Threading.Tasks;
10+
using Azure.Core;
11+
using Azure.ResourceManager.Consumption.Models;
12+
13+
namespace Azure.ResourceManager.Consumption
14+
{
15+
/// <summary>
16+
/// Obsolete backward-compatibility stub for the billing-account scoped consumption resource that
17+
/// existed in the v1.1.0 surface. The TypeSpec migration replaced the wrapper resource with
18+
/// scope-based extension methods on <see cref="ArmClient"/>; this type now throws on every member
19+
/// and is hidden from IntelliSense. Use the scope-based extension methods on <see cref="ArmClient"/>
20+
/// (for example <c>GetConsumptionBalanceResults(scope)</c>, <c>GetConsumptionEventSummaries(scope, ...)</c>,
21+
/// <c>GetConsumptionLotSummaries(scope, ...)</c>, <c>GetConsumptionReservationTransactions(scope, ...)</c>)
22+
/// instead.
23+
/// </summary>
24+
[Obsolete("This type is obsolete and will be removed in a future release.", false)]
25+
[EditorBrowsable(EditorBrowsableState.Never)]
26+
public partial class BillingAccountConsumptionResource : ArmResource
27+
{
28+
/// <summary> Gets the resource type for the operations. </summary>
29+
public static readonly ResourceType ResourceType = "Microsoft.Billing/billingAccounts";
30+
31+
/// <summary> Initializes a new instance of the <see cref="BillingAccountConsumptionResource"/> class for mocking. </summary>
32+
protected BillingAccountConsumptionResource()
33+
{
34+
}
35+
36+
/// <summary> Obsolete. Use <c>ArmClient.GetConsumptionBalanceResult(scope)</c> instead. </summary>
37+
/// <param name="cancellationToken"> The cancellation token to use. </param>
38+
[EditorBrowsable(EditorBrowsableState.Never)]
39+
public virtual Response<ConsumptionBalanceResult> GetBalance(CancellationToken cancellationToken = default)
40+
{
41+
throw new NotSupportedException("This resource type has been removed in the TypeSpec migration. Use ArmClient.GetConsumptionBalanceResult(scope) instead.");
42+
}
43+
44+
/// <summary> Obsolete. Use <c>ArmClient.GetConsumptionBalanceResultAsync(scope)</c> instead. </summary>
45+
/// <param name="cancellationToken"> The cancellation token to use. </param>
46+
[EditorBrowsable(EditorBrowsableState.Never)]
47+
public virtual Task<Response<ConsumptionBalanceResult>> GetBalanceAsync(CancellationToken cancellationToken = default)
48+
{
49+
throw new NotSupportedException("This resource type has been removed in the TypeSpec migration. Use ArmClient.GetConsumptionBalanceResultAsync(scope) instead.");
50+
}
51+
52+
/// <summary> Obsolete. Use <c>ArmClient.GetConsumptionEventSummaries(scope, filter)</c> instead. </summary>
53+
/// <param name="filter"> Optional OData filter expression. </param>
54+
/// <param name="cancellationToken"> The cancellation token to use. </param>
55+
[EditorBrowsable(EditorBrowsableState.Never)]
56+
public virtual Pageable<ConsumptionEventSummary> GetEvents(string filter = null, CancellationToken cancellationToken = default)
57+
{
58+
throw new NotSupportedException("This resource type has been removed in the TypeSpec migration. Use ArmClient.GetConsumptionEventSummaries(scope, filter) instead.");
59+
}
60+
61+
/// <summary> Obsolete. Use <c>ArmClient.GetConsumptionEventSummariesAsync(scope, filter)</c> instead. </summary>
62+
/// <param name="filter"> Optional OData filter expression. </param>
63+
/// <param name="cancellationToken"> The cancellation token to use. </param>
64+
[EditorBrowsable(EditorBrowsableState.Never)]
65+
public virtual AsyncPageable<ConsumptionEventSummary> GetEventsAsync(string filter = null, CancellationToken cancellationToken = default)
66+
{
67+
throw new NotSupportedException("This resource type has been removed in the TypeSpec migration. Use ArmClient.GetConsumptionEventSummariesAsync(scope, filter) instead.");
68+
}
69+
70+
/// <summary> Obsolete. Use <c>ArmClient.GetConsumptionLotSummaries(scope, filter)</c> instead. </summary>
71+
/// <param name="filter"> Optional OData filter expression. </param>
72+
/// <param name="cancellationToken"> The cancellation token to use. </param>
73+
[EditorBrowsable(EditorBrowsableState.Never)]
74+
public virtual Pageable<ConsumptionLotSummary> GetLots(string filter = null, CancellationToken cancellationToken = default)
75+
{
76+
throw new NotSupportedException("This resource type has been removed in the TypeSpec migration. Use ArmClient.GetConsumptionLotSummaries(scope, filter) instead.");
77+
}
78+
79+
/// <summary> Obsolete. Use <c>ArmClient.GetConsumptionLotSummariesAsync(scope, filter)</c> instead. </summary>
80+
/// <param name="filter"> Optional OData filter expression. </param>
81+
/// <param name="cancellationToken"> The cancellation token to use. </param>
82+
[EditorBrowsable(EditorBrowsableState.Never)]
83+
public virtual AsyncPageable<ConsumptionLotSummary> GetLotsAsync(string filter = null, CancellationToken cancellationToken = default)
84+
{
85+
throw new NotSupportedException("This resource type has been removed in the TypeSpec migration. Use ArmClient.GetConsumptionLotSummariesAsync(scope, filter) instead.");
86+
}
87+
88+
/// <summary> Obsolete. Use <c>ArmClient.GetConsumptionReservationTransactions(scope, filter)</c> instead. </summary>
89+
/// <param name="filter"> Optional OData filter expression. </param>
90+
/// <param name="cancellationToken"> The cancellation token to use. </param>
91+
[EditorBrowsable(EditorBrowsableState.Never)]
92+
public virtual Pageable<ConsumptionReservationTransaction> GetReservationTransactions(string filter = null, CancellationToken cancellationToken = default)
93+
{
94+
throw new NotSupportedException("This resource type has been removed in the TypeSpec migration. Use ArmClient.GetConsumptionReservationTransactions(scope, filter) instead.");
95+
}
96+
97+
/// <summary> Obsolete. Use <c>ArmClient.GetConsumptionReservationTransactionsAsync(scope, filter)</c> instead. </summary>
98+
/// <param name="filter"> Optional OData filter expression. </param>
99+
/// <param name="cancellationToken"> The cancellation token to use. </param>
100+
[EditorBrowsable(EditorBrowsableState.Never)]
101+
public virtual AsyncPageable<ConsumptionReservationTransaction> GetReservationTransactionsAsync(string filter = null, CancellationToken cancellationToken = default)
102+
{
103+
throw new NotSupportedException("This resource type has been removed in the TypeSpec migration. Use ArmClient.GetConsumptionReservationTransactionsAsync(scope, filter) instead.");
104+
}
105+
}
106+
}

0 commit comments

Comments
 (0)