< Summary

Class:Azure.ResourceManager.Resources.Models.SubscriptionPolicies
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SubscriptionPolicies.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SubscriptionPolicies.Serialization.cs
Covered lines:23
Uncovered lines:3
Coverable lines:26
Total lines:89
Line coverage:88.4% (23 of 26)
Covered branches:14
Total branches:14
Branch coverage:100% (14 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_LocationPlacementId()-100%100%
get_QuotaId()-100%100%
get_SpendingLimit()-0%100%
DeserializeSubscriptionPolicies(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SubscriptionPolicies.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8namespace Azure.ResourceManager.Resources.Models
 9{
 10    /// <summary> Subscription policies. </summary>
 11    public partial class SubscriptionPolicies
 12    {
 13        /// <summary> Initializes a new instance of SubscriptionPolicies. </summary>
 014        internal SubscriptionPolicies()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of SubscriptionPolicies. </summary>
 19        /// <param name="locationPlacementId"> The subscription location placement ID. The ID indicates which regions ar
 20        /// <param name="quotaId"> The subscription quota ID. </param>
 21        /// <param name="spendingLimit"> The subscription spending limit. </param>
 2422        internal SubscriptionPolicies(string locationPlacementId, string quotaId, SpendingLimit? spendingLimit)
 23        {
 2424            LocationPlacementId = locationPlacementId;
 2425            QuotaId = quotaId;
 2426            SpendingLimit = spendingLimit;
 2427        }
 28
 29        /// <summary> The subscription location placement ID. The ID indicates which regions are visible for a subscript
 830        public string LocationPlacementId { get; }
 31        /// <summary> The subscription quota ID. </summary>
 832        public string QuotaId { get; }
 33        /// <summary> The subscription spending limit. </summary>
 034        public SpendingLimit? SpendingLimit { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SubscriptionPolicies.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Resources.Models
 12{
 13    public partial class SubscriptionPolicies
 14    {
 15        internal static SubscriptionPolicies DeserializeSubscriptionPolicies(JsonElement element)
 16        {
 2417            string locationPlacementId = default;
 2418            string quotaId = default;
 2419            SpendingLimit? spendingLimit = default;
 16020            foreach (var property in element.EnumerateObject())
 21            {
 5622                if (property.NameEquals("locationPlacementId"))
 23                {
 2424                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 2428                    locationPlacementId = property.Value.GetString();
 2429                    continue;
 30                }
 3231                if (property.NameEquals("quotaId"))
 32                {
 2433                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 2437                    quotaId = property.Value.GetString();
 2438                    continue;
 39                }
 840                if (property.NameEquals("spendingLimit"))
 41                {
 842                    if (property.Value.ValueKind == JsonValueKind.Null)
 43                    {
 44                        continue;
 45                    }
 846                    spendingLimit = property.Value.GetString().ToSpendingLimit();
 47                    continue;
 48                }
 49            }
 2450            return new SubscriptionPolicies(locationPlacementId, quotaId, spendingLimit);
 51        }
 52    }
 53}