< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Plan()-0%100%
get_Kind()-0%100%
get_ManagedResourceGroupId()-0%100%
get_ApplicationDefinitionId()-0%100%
get_Parameters()-0%100%
get_Outputs()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeApplication(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Application.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;
 10
 11namespace Azure.ResourceManager.Resources.Models
 12{
 13    /// <summary> Information about managed application. </summary>
 14    public partial class Application : GenericResourceAutoGenerated
 15    {
 16        /// <summary> Initializes a new instance of Application. </summary>
 17        /// <param name="kind"> The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. 
 18        /// <param name="managedResourceGroupId"> The managed resource group Id. </param>
 019        public Application(string kind, string managedResourceGroupId)
 20        {
 021            if (kind == null)
 22            {
 023                throw new ArgumentNullException(nameof(kind));
 24            }
 025            if (managedResourceGroupId == null)
 26            {
 027                throw new ArgumentNullException(nameof(managedResourceGroupId));
 28            }
 29
 030            Kind = kind;
 031            ManagedResourceGroupId = managedResourceGroupId;
 032        }
 33
 34        /// <summary> Initializes a new instance of Application. </summary>
 35        /// <param name="id"> Resource ID. </param>
 36        /// <param name="name"> Resource name. </param>
 37        /// <param name="type"> Resource type. </param>
 38        /// <param name="location"> Resource location. </param>
 39        /// <param name="tags"> Resource tags. </param>
 40        /// <param name="managedBy"> ID of the resource that manages this resource. </param>
 41        /// <param name="sku"> The SKU of the resource. </param>
 42        /// <param name="identity"> The identity of the resource. </param>
 43        /// <param name="plan"> The plan information. </param>
 44        /// <param name="kind"> The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. 
 45        /// <param name="managedResourceGroupId"> The managed resource group Id. </param>
 46        /// <param name="applicationDefinitionId"> The fully qualified path of managed application definition Id. </para
 47        /// <param name="parameters"> Name and value pairs that define the managed application parameters. It can be a J
 48        /// <param name="outputs"> Name and value pairs that define the managed application outputs. </param>
 49        /// <param name="provisioningState"> The managed application provisioning state. </param>
 050        internal Application(string id, string name, string type, string location, IDictionary<string, string> tags, str
 51        {
 052            Plan = plan;
 053            Kind = kind;
 054            ManagedResourceGroupId = managedResourceGroupId;
 055            ApplicationDefinitionId = applicationDefinitionId;
 056            Parameters = parameters;
 057            Outputs = outputs;
 058            ProvisioningState = provisioningState;
 059        }
 60
 61        /// <summary> The plan information. </summary>
 062        public PlanAutoGenerated Plan { get; set; }
 63        /// <summary> The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. </summary>
 064        public string Kind { get; set; }
 65        /// <summary> The managed resource group Id. </summary>
 066        public string ManagedResourceGroupId { get; set; }
 67        /// <summary> The fully qualified path of managed application definition Id. </summary>
 068        public string ApplicationDefinitionId { get; set; }
 69        /// <summary> Name and value pairs that define the managed application parameters. It can be a JObject or a well
 070        public object Parameters { get; set; }
 71        /// <summary> Name and value pairs that define the managed application outputs. </summary>
 072        public object Outputs { get; }
 73        /// <summary> The managed application provisioning state. </summary>
 074        public ProvisioningState? ProvisioningState { get; }
 75    }
 76}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Application.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 Application : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Plan != null)
 20            {
 021                writer.WritePropertyName("plan");
 022                writer.WriteObjectValue(Plan);
 23            }
 024            writer.WritePropertyName("kind");
 025            writer.WriteStringValue(Kind);
 026            if (ManagedBy != null)
 27            {
 028                writer.WritePropertyName("managedBy");
 029                writer.WriteStringValue(ManagedBy);
 30            }
 031            if (Sku != null)
 32            {
 033                writer.WritePropertyName("sku");
 034                writer.WriteObjectValue(Sku);
 35            }
 036            if (Identity != null)
 37            {
 038                writer.WritePropertyName("identity");
 039                writer.WriteObjectValue(Identity);
 40            }
 041            if (Id != null)
 42            {
 043                writer.WritePropertyName("id");
 044                writer.WriteStringValue(Id);
 45            }
 046            if (Name != null)
 47            {
 048                writer.WritePropertyName("name");
 049                writer.WriteStringValue(Name);
 50            }
 051            if (Type != null)
 52            {
 053                writer.WritePropertyName("type");
 054                writer.WriteStringValue(Type);
 55            }
 056            if (Location != null)
 57            {
 058                writer.WritePropertyName("location");
 059                writer.WriteStringValue(Location);
 60            }
 061            if (Tags != null)
 62            {
 063                writer.WritePropertyName("tags");
 064                writer.WriteStartObject();
 065                foreach (var item in Tags)
 66                {
 067                    writer.WritePropertyName(item.Key);
 068                    writer.WriteStringValue(item.Value);
 69                }
 070                writer.WriteEndObject();
 71            }
 072            writer.WritePropertyName("properties");
 073            writer.WriteStartObject();
 074            writer.WritePropertyName("managedResourceGroupId");
 075            writer.WriteStringValue(ManagedResourceGroupId);
 076            if (ApplicationDefinitionId != null)
 77            {
 078                writer.WritePropertyName("applicationDefinitionId");
 079                writer.WriteStringValue(ApplicationDefinitionId);
 80            }
 081            if (Parameters != null)
 82            {
 083                writer.WritePropertyName("parameters");
 084                writer.WriteObjectValue(Parameters);
 85            }
 086            if (Outputs != null)
 87            {
 088                writer.WritePropertyName("outputs");
 089                writer.WriteObjectValue(Outputs);
 90            }
 091            if (ProvisioningState != null)
 92            {
 093                writer.WritePropertyName("provisioningState");
 094                writer.WriteStringValue(ProvisioningState.Value.ToString());
 95            }
 096            writer.WriteEndObject();
 097            writer.WriteEndObject();
 098        }
 99
 100        internal static Application DeserializeApplication(JsonElement element)
 101        {
 0102            PlanAutoGenerated plan = default;
 0103            string kind = default;
 0104            string managedBy = default;
 0105            SkuAutoGenerated sku = default;
 0106            IdentityAutoGenerated2 identity = default;
 0107            string id = default;
 0108            string name = default;
 0109            string type = default;
 0110            string location = default;
 0111            IDictionary<string, string> tags = default;
 0112            string managedResourceGroupId = default;
 0113            string applicationDefinitionId = default;
 0114            object parameters = default;
 0115            object outputs = default;
 0116            ProvisioningState? provisioningState = default;
 0117            foreach (var property in element.EnumerateObject())
 118            {
 0119                if (property.NameEquals("plan"))
 120                {
 0121                    if (property.Value.ValueKind == JsonValueKind.Null)
 122                    {
 123                        continue;
 124                    }
 0125                    plan = PlanAutoGenerated.DeserializePlanAutoGenerated(property.Value);
 0126                    continue;
 127                }
 0128                if (property.NameEquals("kind"))
 129                {
 0130                    kind = property.Value.GetString();
 0131                    continue;
 132                }
 0133                if (property.NameEquals("managedBy"))
 134                {
 0135                    if (property.Value.ValueKind == JsonValueKind.Null)
 136                    {
 137                        continue;
 138                    }
 0139                    managedBy = property.Value.GetString();
 0140                    continue;
 141                }
 0142                if (property.NameEquals("sku"))
 143                {
 0144                    if (property.Value.ValueKind == JsonValueKind.Null)
 145                    {
 146                        continue;
 147                    }
 0148                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
 0149                    continue;
 150                }
 0151                if (property.NameEquals("identity"))
 152                {
 0153                    if (property.Value.ValueKind == JsonValueKind.Null)
 154                    {
 155                        continue;
 156                    }
 0157                    identity = IdentityAutoGenerated2.DeserializeIdentityAutoGenerated2(property.Value);
 0158                    continue;
 159                }
 0160                if (property.NameEquals("id"))
 161                {
 0162                    if (property.Value.ValueKind == JsonValueKind.Null)
 163                    {
 164                        continue;
 165                    }
 0166                    id = property.Value.GetString();
 0167                    continue;
 168                }
 0169                if (property.NameEquals("name"))
 170                {
 0171                    if (property.Value.ValueKind == JsonValueKind.Null)
 172                    {
 173                        continue;
 174                    }
 0175                    name = property.Value.GetString();
 0176                    continue;
 177                }
 0178                if (property.NameEquals("type"))
 179                {
 0180                    if (property.Value.ValueKind == JsonValueKind.Null)
 181                    {
 182                        continue;
 183                    }
 0184                    type = property.Value.GetString();
 0185                    continue;
 186                }
 0187                if (property.NameEquals("location"))
 188                {
 0189                    if (property.Value.ValueKind == JsonValueKind.Null)
 190                    {
 191                        continue;
 192                    }
 0193                    location = property.Value.GetString();
 0194                    continue;
 195                }
 0196                if (property.NameEquals("tags"))
 197                {
 0198                    if (property.Value.ValueKind == JsonValueKind.Null)
 199                    {
 200                        continue;
 201                    }
 0202                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0203                    foreach (var property0 in property.Value.EnumerateObject())
 204                    {
 0205                        if (property0.Value.ValueKind == JsonValueKind.Null)
 206                        {
 0207                            dictionary.Add(property0.Name, null);
 208                        }
 209                        else
 210                        {
 0211                            dictionary.Add(property0.Name, property0.Value.GetString());
 212                        }
 213                    }
 0214                    tags = dictionary;
 0215                    continue;
 216                }
 0217                if (property.NameEquals("properties"))
 218                {
 0219                    foreach (var property0 in property.Value.EnumerateObject())
 220                    {
 0221                        if (property0.NameEquals("managedResourceGroupId"))
 222                        {
 0223                            managedResourceGroupId = property0.Value.GetString();
 0224                            continue;
 225                        }
 0226                        if (property0.NameEquals("applicationDefinitionId"))
 227                        {
 0228                            if (property0.Value.ValueKind == JsonValueKind.Null)
 229                            {
 230                                continue;
 231                            }
 0232                            applicationDefinitionId = property0.Value.GetString();
 0233                            continue;
 234                        }
 0235                        if (property0.NameEquals("parameters"))
 236                        {
 0237                            if (property0.Value.ValueKind == JsonValueKind.Null)
 238                            {
 239                                continue;
 240                            }
 0241                            parameters = property0.Value.GetObject();
 0242                            continue;
 243                        }
 0244                        if (property0.NameEquals("outputs"))
 245                        {
 0246                            if (property0.Value.ValueKind == JsonValueKind.Null)
 247                            {
 248                                continue;
 249                            }
 0250                            outputs = property0.Value.GetObject();
 0251                            continue;
 252                        }
 0253                        if (property0.NameEquals("provisioningState"))
 254                        {
 0255                            if (property0.Value.ValueKind == JsonValueKind.Null)
 256                            {
 257                                continue;
 258                            }
 0259                            provisioningState = new ProvisioningState(property0.Value.GetString());
 260                            continue;
 261                        }
 262                    }
 263                    continue;
 264                }
 265            }
 0266            return new Application(id, name, type, location, tags, managedBy, sku, identity, plan, kind, managedResource
 267        }
 268    }
 269}