< Summary

Class:Azure.ResourceManager.Resources.Models.ApplicationDefinition
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ApplicationDefinition.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ApplicationDefinition.Serialization.cs
Covered lines:0
Uncovered lines:192
Coverable lines:192
Total lines:414
Line coverage:0% (0 of 192)
Covered branches:0
Total branches:122
Branch coverage:0% (0 of 122)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_LockLevel()-0%100%
get_DisplayName()-0%100%
get_IsEnabled()-0%100%
get_Authorizations()-0%100%
get_Artifacts()-0%100%
get_Description()-0%100%
get_PackageFileUri()-0%100%
get_MainTemplate()-0%100%
get_CreateUiDefinition()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeApplicationDefinition(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ApplicationDefinition.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;
 9using System.Collections.Generic;
 10using System.Linq;
 11
 12namespace Azure.ResourceManager.Resources.Models
 13{
 14    /// <summary> Information about managed application definition. </summary>
 15    public partial class ApplicationDefinition : GenericResourceAutoGenerated
 16    {
 17        /// <summary> Initializes a new instance of ApplicationDefinition. </summary>
 18        /// <param name="lockLevel"> The managed application lock level. </param>
 19        /// <param name="authorizations"> The managed application provider authorizations. </param>
 020        public ApplicationDefinition(ApplicationLockLevel lockLevel, IEnumerable<ApplicationProviderAuthorization> autho
 21        {
 022            if (authorizations == null)
 23            {
 024                throw new ArgumentNullException(nameof(authorizations));
 25            }
 26
 027            LockLevel = lockLevel;
 028            Authorizations = authorizations.ToList();
 029        }
 30
 31        /// <summary> Initializes a new instance of ApplicationDefinition. </summary>
 32        /// <param name="id"> Resource ID. </param>
 33        /// <param name="name"> Resource name. </param>
 34        /// <param name="type"> Resource type. </param>
 35        /// <param name="location"> Resource location. </param>
 36        /// <param name="tags"> Resource tags. </param>
 37        /// <param name="managedBy"> ID of the resource that manages this resource. </param>
 38        /// <param name="sku"> The SKU of the resource. </param>
 39        /// <param name="identity"> The identity of the resource. </param>
 40        /// <param name="lockLevel"> The managed application lock level. </param>
 41        /// <param name="displayName"> The managed application definition display name. </param>
 42        /// <param name="isEnabled"> A value indicating whether the package is enabled or not. </param>
 43        /// <param name="authorizations"> The managed application provider authorizations. </param>
 44        /// <param name="artifacts"> The collection of managed application artifacts. The portal will use the files spec
 45        /// <param name="description"> The managed application definition description. </param>
 46        /// <param name="packageFileUri"> The managed application definition package file Uri. Use this element. </param
 47        /// <param name="mainTemplate"> The inline main template json which has resources to be provisioned. It can be a
 48        /// <param name="createUiDefinition"> The createUiDefinition json for the backing template with Microsoft.Soluti
 049        internal ApplicationDefinition(string id, string name, string type, string location, IDictionary<string, string>
 50        {
 051            LockLevel = lockLevel;
 052            DisplayName = displayName;
 053            IsEnabled = isEnabled;
 054            Authorizations = authorizations ?? new List<ApplicationProviderAuthorization>();
 055            Artifacts = artifacts;
 056            Description = description;
 057            PackageFileUri = packageFileUri;
 058            MainTemplate = mainTemplate;
 059            CreateUiDefinition = createUiDefinition;
 060        }
 61
 62        /// <summary> The managed application lock level. </summary>
 063        public ApplicationLockLevel LockLevel { get; set; }
 64        /// <summary> The managed application definition display name. </summary>
 065        public string DisplayName { get; set; }
 66        /// <summary> A value indicating whether the package is enabled or not. </summary>
 067        public string IsEnabled { get; set; }
 68        /// <summary> The managed application provider authorizations. </summary>
 069        public IList<ApplicationProviderAuthorization> Authorizations { get; }
 70        /// <summary> The collection of managed application artifacts. The portal will use the files specified as artifa
 071        public IList<ApplicationArtifact> Artifacts { get; set; }
 72        /// <summary> The managed application definition description. </summary>
 073        public string Description { get; set; }
 74        /// <summary> The managed application definition package file Uri. Use this element. </summary>
 075        public string PackageFileUri { get; set; }
 76        /// <summary> The inline main template json which has resources to be provisioned. It can be a JObject or well-f
 077        public object MainTemplate { get; set; }
 78        /// <summary> The createUiDefinition json for the backing template with Microsoft.Solutions/applications resourc
 079        public object CreateUiDefinition { get; set; }
 80    }
 81}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ApplicationDefinition.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Resources.Models
 13{
 14    public partial class ApplicationDefinition : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (ManagedBy != null)
 20            {
 021                writer.WritePropertyName("managedBy");
 022                writer.WriteStringValue(ManagedBy);
 23            }
 024            if (Sku != null)
 25            {
 026                writer.WritePropertyName("sku");
 027                writer.WriteObjectValue(Sku);
 28            }
 029            if (Identity != null)
 30            {
 031                writer.WritePropertyName("identity");
 032                writer.WriteObjectValue(Identity);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            if (Name != null)
 40            {
 041                writer.WritePropertyName("name");
 042                writer.WriteStringValue(Name);
 43            }
 044            if (Type != null)
 45            {
 046                writer.WritePropertyName("type");
 047                writer.WriteStringValue(Type);
 48            }
 049            if (Location != null)
 50            {
 051                writer.WritePropertyName("location");
 052                writer.WriteStringValue(Location);
 53            }
 054            if (Tags != null)
 55            {
 056                writer.WritePropertyName("tags");
 057                writer.WriteStartObject();
 058                foreach (var item in Tags)
 59                {
 060                    writer.WritePropertyName(item.Key);
 061                    writer.WriteStringValue(item.Value);
 62                }
 063                writer.WriteEndObject();
 64            }
 065            writer.WritePropertyName("properties");
 066            writer.WriteStartObject();
 067            writer.WritePropertyName("lockLevel");
 068            writer.WriteStringValue(LockLevel.ToSerialString());
 069            if (DisplayName != null)
 70            {
 071                writer.WritePropertyName("displayName");
 072                writer.WriteStringValue(DisplayName);
 73            }
 074            if (IsEnabled != null)
 75            {
 076                writer.WritePropertyName("isEnabled");
 077                writer.WriteStringValue(IsEnabled);
 78            }
 079            writer.WritePropertyName("authorizations");
 080            writer.WriteStartArray();
 081            foreach (var item in Authorizations)
 82            {
 083                writer.WriteObjectValue(item);
 84            }
 085            writer.WriteEndArray();
 086            if (Artifacts != null)
 87            {
 088                writer.WritePropertyName("artifacts");
 089                writer.WriteStartArray();
 090                foreach (var item in Artifacts)
 91                {
 092                    writer.WriteObjectValue(item);
 93                }
 094                writer.WriteEndArray();
 95            }
 096            if (Description != null)
 97            {
 098                writer.WritePropertyName("description");
 099                writer.WriteStringValue(Description);
 100            }
 0101            if (PackageFileUri != null)
 102            {
 0103                writer.WritePropertyName("packageFileUri");
 0104                writer.WriteStringValue(PackageFileUri);
 105            }
 0106            if (MainTemplate != null)
 107            {
 0108                writer.WritePropertyName("mainTemplate");
 0109                writer.WriteObjectValue(MainTemplate);
 110            }
 0111            if (CreateUiDefinition != null)
 112            {
 0113                writer.WritePropertyName("createUiDefinition");
 0114                writer.WriteObjectValue(CreateUiDefinition);
 115            }
 0116            writer.WriteEndObject();
 0117            writer.WriteEndObject();
 0118        }
 119
 120        internal static ApplicationDefinition DeserializeApplicationDefinition(JsonElement element)
 121        {
 0122            string managedBy = default;
 0123            SkuAutoGenerated sku = default;
 0124            IdentityAutoGenerated2 identity = default;
 0125            string id = default;
 0126            string name = default;
 0127            string type = default;
 0128            string location = default;
 0129            IDictionary<string, string> tags = default;
 0130            ApplicationLockLevel lockLevel = default;
 0131            string displayName = default;
 0132            string isEnabled = default;
 0133            IList<ApplicationProviderAuthorization> authorizations = default;
 0134            IList<ApplicationArtifact> artifacts = default;
 0135            string description = default;
 0136            string packageFileUri = default;
 0137            object mainTemplate = default;
 0138            object createUiDefinition = default;
 0139            foreach (var property in element.EnumerateObject())
 140            {
 0141                if (property.NameEquals("managedBy"))
 142                {
 0143                    if (property.Value.ValueKind == JsonValueKind.Null)
 144                    {
 145                        continue;
 146                    }
 0147                    managedBy = property.Value.GetString();
 0148                    continue;
 149                }
 0150                if (property.NameEquals("sku"))
 151                {
 0152                    if (property.Value.ValueKind == JsonValueKind.Null)
 153                    {
 154                        continue;
 155                    }
 0156                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
 0157                    continue;
 158                }
 0159                if (property.NameEquals("identity"))
 160                {
 0161                    if (property.Value.ValueKind == JsonValueKind.Null)
 162                    {
 163                        continue;
 164                    }
 0165                    identity = IdentityAutoGenerated2.DeserializeIdentityAutoGenerated2(property.Value);
 0166                    continue;
 167                }
 0168                if (property.NameEquals("id"))
 169                {
 0170                    if (property.Value.ValueKind == JsonValueKind.Null)
 171                    {
 172                        continue;
 173                    }
 0174                    id = property.Value.GetString();
 0175                    continue;
 176                }
 0177                if (property.NameEquals("name"))
 178                {
 0179                    if (property.Value.ValueKind == JsonValueKind.Null)
 180                    {
 181                        continue;
 182                    }
 0183                    name = property.Value.GetString();
 0184                    continue;
 185                }
 0186                if (property.NameEquals("type"))
 187                {
 0188                    if (property.Value.ValueKind == JsonValueKind.Null)
 189                    {
 190                        continue;
 191                    }
 0192                    type = property.Value.GetString();
 0193                    continue;
 194                }
 0195                if (property.NameEquals("location"))
 196                {
 0197                    if (property.Value.ValueKind == JsonValueKind.Null)
 198                    {
 199                        continue;
 200                    }
 0201                    location = property.Value.GetString();
 0202                    continue;
 203                }
 0204                if (property.NameEquals("tags"))
 205                {
 0206                    if (property.Value.ValueKind == JsonValueKind.Null)
 207                    {
 208                        continue;
 209                    }
 0210                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0211                    foreach (var property0 in property.Value.EnumerateObject())
 212                    {
 0213                        if (property0.Value.ValueKind == JsonValueKind.Null)
 214                        {
 0215                            dictionary.Add(property0.Name, null);
 216                        }
 217                        else
 218                        {
 0219                            dictionary.Add(property0.Name, property0.Value.GetString());
 220                        }
 221                    }
 0222                    tags = dictionary;
 0223                    continue;
 224                }
 0225                if (property.NameEquals("properties"))
 226                {
 0227                    foreach (var property0 in property.Value.EnumerateObject())
 228                    {
 0229                        if (property0.NameEquals("lockLevel"))
 230                        {
 0231                            lockLevel = property0.Value.GetString().ToApplicationLockLevel();
 0232                            continue;
 233                        }
 0234                        if (property0.NameEquals("displayName"))
 235                        {
 0236                            if (property0.Value.ValueKind == JsonValueKind.Null)
 237                            {
 238                                continue;
 239                            }
 0240                            displayName = property0.Value.GetString();
 0241                            continue;
 242                        }
 0243                        if (property0.NameEquals("isEnabled"))
 244                        {
 0245                            if (property0.Value.ValueKind == JsonValueKind.Null)
 246                            {
 247                                continue;
 248                            }
 0249                            isEnabled = property0.Value.GetString();
 0250                            continue;
 251                        }
 0252                        if (property0.NameEquals("authorizations"))
 253                        {
 0254                            List<ApplicationProviderAuthorization> array = new List<ApplicationProviderAuthorization>();
 0255                            foreach (var item in property0.Value.EnumerateArray())
 256                            {
 0257                                if (item.ValueKind == JsonValueKind.Null)
 258                                {
 0259                                    array.Add(null);
 260                                }
 261                                else
 262                                {
 0263                                    array.Add(ApplicationProviderAuthorization.DeserializeApplicationProviderAuthorizati
 264                                }
 265                            }
 0266                            authorizations = array;
 0267                            continue;
 268                        }
 0269                        if (property0.NameEquals("artifacts"))
 270                        {
 0271                            if (property0.Value.ValueKind == JsonValueKind.Null)
 272                            {
 273                                continue;
 274                            }
 0275                            List<ApplicationArtifact> array = new List<ApplicationArtifact>();
 0276                            foreach (var item in property0.Value.EnumerateArray())
 277                            {
 0278                                if (item.ValueKind == JsonValueKind.Null)
 279                                {
 0280                                    array.Add(null);
 281                                }
 282                                else
 283                                {
 0284                                    array.Add(ApplicationArtifact.DeserializeApplicationArtifact(item));
 285                                }
 286                            }
 0287                            artifacts = array;
 0288                            continue;
 289                        }
 0290                        if (property0.NameEquals("description"))
 291                        {
 0292                            if (property0.Value.ValueKind == JsonValueKind.Null)
 293                            {
 294                                continue;
 295                            }
 0296                            description = property0.Value.GetString();
 0297                            continue;
 298                        }
 0299                        if (property0.NameEquals("packageFileUri"))
 300                        {
 0301                            if (property0.Value.ValueKind == JsonValueKind.Null)
 302                            {
 303                                continue;
 304                            }
 0305                            packageFileUri = property0.Value.GetString();
 0306                            continue;
 307                        }
 0308                        if (property0.NameEquals("mainTemplate"))
 309                        {
 0310                            if (property0.Value.ValueKind == JsonValueKind.Null)
 311                            {
 312                                continue;
 313                            }
 0314                            mainTemplate = property0.Value.GetObject();
 0315                            continue;
 316                        }
 0317                        if (property0.NameEquals("createUiDefinition"))
 318                        {
 0319                            if (property0.Value.ValueKind == JsonValueKind.Null)
 320                            {
 321                                continue;
 322                            }
 0323                            createUiDefinition = property0.Value.GetObject();
 324                            continue;
 325                        }
 326                    }
 327                    continue;
 328                }
 329            }
 0330            return new ApplicationDefinition(id, name, type, location, tags, managedBy, sku, identity, lockLevel, displa
 331        }
 332    }
 333}