< Summary

Class:Azure.ResourceManager.Network.Models.FlowLog
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FlowLog.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FlowLog.Serialization.cs
Covered lines:0
Uncovered lines:152
Coverable lines:152
Total lines:335
Line coverage:0% (0 of 152)
Covered branches:0
Total branches:96
Branch coverage:0% (0 of 96)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_TargetResourceId()-0%100%
get_TargetResourceGuid()-0%100%
get_StorageId()-0%100%
get_Enabled()-0%100%
get_RetentionPolicy()-0%100%
get_Format()-0%100%
get_FlowAnalyticsConfiguration()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeFlowLog(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FlowLog.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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> A flow log resource. </summary>
 13    public partial class FlowLog : Resource
 14    {
 15        /// <summary> Initializes a new instance of FlowLog. </summary>
 016        public FlowLog()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of FlowLog. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Resource name. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="location"> Resource location. </param>
 25        /// <param name="tags"> Resource tags. </param>
 26        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 27        /// <param name="targetResourceId"> ID of network security group to which flow log will be applied. </param>
 28        /// <param name="targetResourceGuid"> Guid of network security group to which flow log will be applied. </param>
 29        /// <param name="storageId"> ID of the storage account which is used to store the flow log. </param>
 30        /// <param name="enabled"> Flag to enable/disable flow logging. </param>
 31        /// <param name="retentionPolicy"> Parameters that define the retention policy for flow log. </param>
 32        /// <param name="format"> Parameters that define the flow log format. </param>
 33        /// <param name="flowAnalyticsConfiguration"> Parameters that define the configuration of traffic analytics. </p
 34        /// <param name="provisioningState"> The provisioning state of the flow log. </param>
 035        internal FlowLog(string id, string name, string type, string location, IDictionary<string, string> tags, string 
 36        {
 037            Etag = etag;
 038            TargetResourceId = targetResourceId;
 039            TargetResourceGuid = targetResourceGuid;
 040            StorageId = storageId;
 041            Enabled = enabled;
 042            RetentionPolicy = retentionPolicy;
 043            Format = format;
 044            FlowAnalyticsConfiguration = flowAnalyticsConfiguration;
 045            ProvisioningState = provisioningState;
 046        }
 47
 48        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 049        public string Etag { get; }
 50        /// <summary> ID of network security group to which flow log will be applied. </summary>
 051        public string TargetResourceId { get; set; }
 52        /// <summary> Guid of network security group to which flow log will be applied. </summary>
 053        public string TargetResourceGuid { get; }
 54        /// <summary> ID of the storage account which is used to store the flow log. </summary>
 055        public string StorageId { get; set; }
 56        /// <summary> Flag to enable/disable flow logging. </summary>
 057        public bool? Enabled { get; set; }
 58        /// <summary> Parameters that define the retention policy for flow log. </summary>
 059        public RetentionPolicyParameters RetentionPolicy { get; set; }
 60        /// <summary> Parameters that define the flow log format. </summary>
 061        public FlowLogFormatParameters Format { get; set; }
 62        /// <summary> Parameters that define the configuration of traffic analytics. </summary>
 063        public TrafficAnalyticsProperties FlowAnalyticsConfiguration { get; set; }
 64        /// <summary> The provisioning state of the flow log. </summary>
 065        public ProvisioningState? ProvisioningState { get; }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FlowLog.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.Network.Models
 13{
 14    public partial class FlowLog : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Etag != null)
 20            {
 021                writer.WritePropertyName("etag");
 022                writer.WriteStringValue(Etag);
 23            }
 024            if (Id != null)
 25            {
 026                writer.WritePropertyName("id");
 027                writer.WriteStringValue(Id);
 28            }
 029            if (Name != null)
 30            {
 031                writer.WritePropertyName("name");
 032                writer.WriteStringValue(Name);
 33            }
 034            if (Type != null)
 35            {
 036                writer.WritePropertyName("type");
 037                writer.WriteStringValue(Type);
 38            }
 039            if (Location != null)
 40            {
 041                writer.WritePropertyName("location");
 042                writer.WriteStringValue(Location);
 43            }
 044            if (Tags != null)
 45            {
 046                writer.WritePropertyName("tags");
 047                writer.WriteStartObject();
 048                foreach (var item in Tags)
 49                {
 050                    writer.WritePropertyName(item.Key);
 051                    writer.WriteStringValue(item.Value);
 52                }
 053                writer.WriteEndObject();
 54            }
 055            writer.WritePropertyName("properties");
 056            writer.WriteStartObject();
 057            if (TargetResourceId != null)
 58            {
 059                writer.WritePropertyName("targetResourceId");
 060                writer.WriteStringValue(TargetResourceId);
 61            }
 062            if (TargetResourceGuid != null)
 63            {
 064                writer.WritePropertyName("targetResourceGuid");
 065                writer.WriteStringValue(TargetResourceGuid);
 66            }
 067            if (StorageId != null)
 68            {
 069                writer.WritePropertyName("storageId");
 070                writer.WriteStringValue(StorageId);
 71            }
 072            if (Enabled != null)
 73            {
 074                writer.WritePropertyName("enabled");
 075                writer.WriteBooleanValue(Enabled.Value);
 76            }
 077            if (RetentionPolicy != null)
 78            {
 079                writer.WritePropertyName("retentionPolicy");
 080                writer.WriteObjectValue(RetentionPolicy);
 81            }
 082            if (Format != null)
 83            {
 084                writer.WritePropertyName("format");
 085                writer.WriteObjectValue(Format);
 86            }
 087            if (FlowAnalyticsConfiguration != null)
 88            {
 089                writer.WritePropertyName("flowAnalyticsConfiguration");
 090                writer.WriteObjectValue(FlowAnalyticsConfiguration);
 91            }
 092            if (ProvisioningState != null)
 93            {
 094                writer.WritePropertyName("provisioningState");
 095                writer.WriteStringValue(ProvisioningState.Value.ToString());
 96            }
 097            writer.WriteEndObject();
 098            writer.WriteEndObject();
 099        }
 100
 101        internal static FlowLog DeserializeFlowLog(JsonElement element)
 102        {
 0103            string etag = default;
 0104            string id = default;
 0105            string name = default;
 0106            string type = default;
 0107            string location = default;
 0108            IDictionary<string, string> tags = default;
 0109            string targetResourceId = default;
 0110            string targetResourceGuid = default;
 0111            string storageId = default;
 0112            bool? enabled = default;
 0113            RetentionPolicyParameters retentionPolicy = default;
 0114            FlowLogFormatParameters format = default;
 0115            TrafficAnalyticsProperties flowAnalyticsConfiguration = default;
 0116            ProvisioningState? provisioningState = default;
 0117            foreach (var property in element.EnumerateObject())
 118            {
 0119                if (property.NameEquals("etag"))
 120                {
 0121                    if (property.Value.ValueKind == JsonValueKind.Null)
 122                    {
 123                        continue;
 124                    }
 0125                    etag = property.Value.GetString();
 0126                    continue;
 127                }
 0128                if (property.NameEquals("id"))
 129                {
 0130                    if (property.Value.ValueKind == JsonValueKind.Null)
 131                    {
 132                        continue;
 133                    }
 0134                    id = property.Value.GetString();
 0135                    continue;
 136                }
 0137                if (property.NameEquals("name"))
 138                {
 0139                    if (property.Value.ValueKind == JsonValueKind.Null)
 140                    {
 141                        continue;
 142                    }
 0143                    name = property.Value.GetString();
 0144                    continue;
 145                }
 0146                if (property.NameEquals("type"))
 147                {
 0148                    if (property.Value.ValueKind == JsonValueKind.Null)
 149                    {
 150                        continue;
 151                    }
 0152                    type = property.Value.GetString();
 0153                    continue;
 154                }
 0155                if (property.NameEquals("location"))
 156                {
 0157                    if (property.Value.ValueKind == JsonValueKind.Null)
 158                    {
 159                        continue;
 160                    }
 0161                    location = property.Value.GetString();
 0162                    continue;
 163                }
 0164                if (property.NameEquals("tags"))
 165                {
 0166                    if (property.Value.ValueKind == JsonValueKind.Null)
 167                    {
 168                        continue;
 169                    }
 0170                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0171                    foreach (var property0 in property.Value.EnumerateObject())
 172                    {
 0173                        if (property0.Value.ValueKind == JsonValueKind.Null)
 174                        {
 0175                            dictionary.Add(property0.Name, null);
 176                        }
 177                        else
 178                        {
 0179                            dictionary.Add(property0.Name, property0.Value.GetString());
 180                        }
 181                    }
 0182                    tags = dictionary;
 0183                    continue;
 184                }
 0185                if (property.NameEquals("properties"))
 186                {
 0187                    foreach (var property0 in property.Value.EnumerateObject())
 188                    {
 0189                        if (property0.NameEquals("targetResourceId"))
 190                        {
 0191                            if (property0.Value.ValueKind == JsonValueKind.Null)
 192                            {
 193                                continue;
 194                            }
 0195                            targetResourceId = property0.Value.GetString();
 0196                            continue;
 197                        }
 0198                        if (property0.NameEquals("targetResourceGuid"))
 199                        {
 0200                            if (property0.Value.ValueKind == JsonValueKind.Null)
 201                            {
 202                                continue;
 203                            }
 0204                            targetResourceGuid = property0.Value.GetString();
 0205                            continue;
 206                        }
 0207                        if (property0.NameEquals("storageId"))
 208                        {
 0209                            if (property0.Value.ValueKind == JsonValueKind.Null)
 210                            {
 211                                continue;
 212                            }
 0213                            storageId = property0.Value.GetString();
 0214                            continue;
 215                        }
 0216                        if (property0.NameEquals("enabled"))
 217                        {
 0218                            if (property0.Value.ValueKind == JsonValueKind.Null)
 219                            {
 220                                continue;
 221                            }
 0222                            enabled = property0.Value.GetBoolean();
 0223                            continue;
 224                        }
 0225                        if (property0.NameEquals("retentionPolicy"))
 226                        {
 0227                            if (property0.Value.ValueKind == JsonValueKind.Null)
 228                            {
 229                                continue;
 230                            }
 0231                            retentionPolicy = RetentionPolicyParameters.DeserializeRetentionPolicyParameters(property0.V
 0232                            continue;
 233                        }
 0234                        if (property0.NameEquals("format"))
 235                        {
 0236                            if (property0.Value.ValueKind == JsonValueKind.Null)
 237                            {
 238                                continue;
 239                            }
 0240                            format = FlowLogFormatParameters.DeserializeFlowLogFormatParameters(property0.Value);
 0241                            continue;
 242                        }
 0243                        if (property0.NameEquals("flowAnalyticsConfiguration"))
 244                        {
 0245                            if (property0.Value.ValueKind == JsonValueKind.Null)
 246                            {
 247                                continue;
 248                            }
 0249                            flowAnalyticsConfiguration = TrafficAnalyticsProperties.DeserializeTrafficAnalyticsPropertie
 0250                            continue;
 251                        }
 0252                        if (property0.NameEquals("provisioningState"))
 253                        {
 0254                            if (property0.Value.ValueKind == JsonValueKind.Null)
 255                            {
 256                                continue;
 257                            }
 0258                            provisioningState = new ProvisioningState(property0.Value.GetString());
 259                            continue;
 260                        }
 261                    }
 262                    continue;
 263                }
 264            }
 0265            return new FlowLog(id, name, type, location, tags, etag, targetResourceId, targetResourceGuid, storageId, en
 266        }
 267    }
 268}