From e824ceb5d5d890cc8e07446c28a3cbd5cbb03798 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 28 Oct 2022 10:19:18 +0000 Subject: [PATCH] CodeGen from PR 21241 in Azure/azure-rest-api-specs Migrate to net track2 for some resource-manager readmes batch 3 (#21241) * migrate to track 2 * revert configs for machinelearning and managementgroups * resolve Go SDK automation failure Co-authored-by: Chenjie Shi --- .../BillingSubscriptionsListResult.Serialization.cs | 13 ++++++++++++- .../Models/BillingSubscriptionsListResult.cs | 6 +++++- .../Azure.ResourceManager.Billing/src/autorest.md | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Models/BillingSubscriptionsListResult.Serialization.cs b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Models/BillingSubscriptionsListResult.Serialization.cs index d2c1c99d8b43..6c37d367dd44 100644 --- a/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Models/BillingSubscriptionsListResult.Serialization.cs +++ b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Models/BillingSubscriptionsListResult.Serialization.cs @@ -17,6 +17,7 @@ internal partial class BillingSubscriptionsListResult internal static BillingSubscriptionsListResult DeserializeBillingSubscriptionsListResult(JsonElement element) { Optional> value = default; + Optional totalCount = default; Optional nextLink = default; foreach (var property in element.EnumerateObject()) { @@ -35,13 +36,23 @@ internal static BillingSubscriptionsListResult DeserializeBillingSubscriptionsLi value = array; continue; } + if (property.NameEquals("totalCount")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + totalCount = property.Value.GetInt32(); + continue; + } if (property.NameEquals("nextLink")) { nextLink = property.Value.GetString(); continue; } } - return new BillingSubscriptionsListResult(Optional.ToList(value), nextLink.Value); + return new BillingSubscriptionsListResult(Optional.ToList(value), Optional.ToNullable(totalCount), nextLink.Value); } } } diff --git a/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs index 0b5a95bb008b..5f00ca05dee8 100644 --- a/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs +++ b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs @@ -22,15 +22,19 @@ internal BillingSubscriptionsListResult() /// Initializes a new instance of BillingSubscriptionsListResult. /// The list of billing subscriptions. + /// Total number of records. /// The link (url) to the next page of results. - internal BillingSubscriptionsListResult(IReadOnlyList value, string nextLink) + internal BillingSubscriptionsListResult(IReadOnlyList value, int? totalCount, string nextLink) { Value = value; + TotalCount = totalCount; NextLink = nextLink; } /// The list of billing subscriptions. public IReadOnlyList Value { get; } + /// Total number of records. + public int? TotalCount { get; } /// The link (url) to the next page of results. public string NextLink { get; } } diff --git a/sdk/billing/Azure.ResourceManager.Billing/src/autorest.md b/sdk/billing/Azure.ResourceManager.Billing/src/autorest.md index c4db57c596f4..1aa8682124ed 100644 --- a/sdk/billing/Azure.ResourceManager.Billing/src/autorest.md +++ b/sdk/billing/Azure.ResourceManager.Billing/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Billing namespace: Azure.ResourceManager.Billing -require: https://github.com/Azure/azure-rest-api-specs/blob/6b08774c89877269e73e11ac3ecbd1bd4e14f5a0/specification/billing/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/billing/resource-manager/readme.md tag: package-2021-10 output-folder: $(this-folder)/Generated clear-output-folder: true