< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FlowLogInformation.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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> Information on the configuration of flow log and traffic analytics (optional) . </summary>
 13    public partial class FlowLogInformation
 14    {
 15        /// <summary> Initializes a new instance of FlowLogInformation. </summary>
 16        /// <param name="targetResourceId"> The ID of the resource to configure for flow log and traffic analytics (opti
 17        /// <param name="storageId"> ID of the storage account which is used to store the flow log. </param>
 18        /// <param name="enabled"> Flag to enable/disable flow logging. </param>
 019        public FlowLogInformation(string targetResourceId, string storageId, bool enabled)
 20        {
 021            if (targetResourceId == null)
 22            {
 023                throw new ArgumentNullException(nameof(targetResourceId));
 24            }
 025            if (storageId == null)
 26            {
 027                throw new ArgumentNullException(nameof(storageId));
 28            }
 29
 030            TargetResourceId = targetResourceId;
 031            StorageId = storageId;
 032            Enabled = enabled;
 033        }
 34
 35        /// <summary> Initializes a new instance of FlowLogInformation. </summary>
 36        /// <param name="targetResourceId"> The ID of the resource to configure for flow log and traffic analytics (opti
 37        /// <param name="flowAnalyticsConfiguration"> Parameters that define the configuration of traffic analytics. </p
 38        /// <param name="storageId"> ID of the storage account which is used to store the flow log. </param>
 39        /// <param name="enabled"> Flag to enable/disable flow logging. </param>
 40        /// <param name="retentionPolicy"> Parameters that define the retention policy for flow log. </param>
 41        /// <param name="format"> Parameters that define the flow log format. </param>
 042        internal FlowLogInformation(string targetResourceId, TrafficAnalyticsProperties flowAnalyticsConfiguration, stri
 43        {
 044            TargetResourceId = targetResourceId;
 045            FlowAnalyticsConfiguration = flowAnalyticsConfiguration;
 046            StorageId = storageId;
 047            Enabled = enabled;
 048            RetentionPolicy = retentionPolicy;
 049            Format = format;
 050        }
 51
 52        /// <summary> The ID of the resource to configure for flow log and traffic analytics (optional) . </summary>
 053        public string TargetResourceId { get; set; }
 54        /// <summary> Parameters that define the configuration of traffic analytics. </summary>
 055        public TrafficAnalyticsProperties FlowAnalyticsConfiguration { get; set; }
 56        /// <summary> ID of the storage account which is used to store the flow log. </summary>
 057        public string StorageId { get; set; }
 58        /// <summary> Flag to enable/disable flow logging. </summary>
 059        public bool Enabled { get; set; }
 60        /// <summary> Parameters that define the retention policy for flow log. </summary>
 061        public RetentionPolicyParameters RetentionPolicy { get; set; }
 62        /// <summary> Parameters that define the flow log format. </summary>
 063        public FlowLogFormatParameters Format { get; set; }
 64    }
 65}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FlowLogInformation.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.Network.Models
 12{
 13    public partial class FlowLogInformation : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("targetResourceId");
 019            writer.WriteStringValue(TargetResourceId);
 020            if (FlowAnalyticsConfiguration != null)
 21            {
 022                writer.WritePropertyName("flowAnalyticsConfiguration");
 023                writer.WriteObjectValue(FlowAnalyticsConfiguration);
 24            }
 025            writer.WritePropertyName("properties");
 026            writer.WriteStartObject();
 027            writer.WritePropertyName("storageId");
 028            writer.WriteStringValue(StorageId);
 029            writer.WritePropertyName("enabled");
 030            writer.WriteBooleanValue(Enabled);
 031            if (RetentionPolicy != null)
 32            {
 033                writer.WritePropertyName("retentionPolicy");
 034                writer.WriteObjectValue(RetentionPolicy);
 35            }
 036            if (Format != null)
 37            {
 038                writer.WritePropertyName("format");
 039                writer.WriteObjectValue(Format);
 40            }
 041            writer.WriteEndObject();
 042            writer.WriteEndObject();
 043        }
 44
 45        internal static FlowLogInformation DeserializeFlowLogInformation(JsonElement element)
 46        {
 047            string targetResourceId = default;
 048            TrafficAnalyticsProperties flowAnalyticsConfiguration = default;
 049            string storageId = default;
 050            bool enabled = default;
 051            RetentionPolicyParameters retentionPolicy = default;
 052            FlowLogFormatParameters format = default;
 053            foreach (var property in element.EnumerateObject())
 54            {
 055                if (property.NameEquals("targetResourceId"))
 56                {
 057                    targetResourceId = property.Value.GetString();
 058                    continue;
 59                }
 060                if (property.NameEquals("flowAnalyticsConfiguration"))
 61                {
 062                    if (property.Value.ValueKind == JsonValueKind.Null)
 63                    {
 64                        continue;
 65                    }
 066                    flowAnalyticsConfiguration = TrafficAnalyticsProperties.DeserializeTrafficAnalyticsProperties(proper
 067                    continue;
 68                }
 069                if (property.NameEquals("properties"))
 70                {
 071                    foreach (var property0 in property.Value.EnumerateObject())
 72                    {
 073                        if (property0.NameEquals("storageId"))
 74                        {
 075                            storageId = property0.Value.GetString();
 076                            continue;
 77                        }
 078                        if (property0.NameEquals("enabled"))
 79                        {
 080                            enabled = property0.Value.GetBoolean();
 081                            continue;
 82                        }
 083                        if (property0.NameEquals("retentionPolicy"))
 84                        {
 085                            if (property0.Value.ValueKind == JsonValueKind.Null)
 86                            {
 87                                continue;
 88                            }
 089                            retentionPolicy = RetentionPolicyParameters.DeserializeRetentionPolicyParameters(property0.V
 090                            continue;
 91                        }
 092                        if (property0.NameEquals("format"))
 93                        {
 094                            if (property0.Value.ValueKind == JsonValueKind.Null)
 95                            {
 96                                continue;
 97                            }
 098                            format = FlowLogFormatParameters.DeserializeFlowLogFormatParameters(property0.Value);
 99                            continue;
 100                        }
 101                    }
 102                    continue;
 103                }
 104            }
 0105            return new FlowLogInformation(targetResourceId, flowAnalyticsConfiguration, storageId, enabled, retentionPol
 106        }
 107    }
 108}