< Summary

Class:Azure.ResourceManager.Resources.Models.SystemData
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SystemData.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SystemData.Serialization.cs
Covered lines:39
Uncovered lines:29
Coverable lines:68
Total lines:170
Line coverage:57.3% (39 of 68)
Covered branches:26
Total branches:38
Branch coverage:68.4% (26 of 38)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_CreatedBy()-0%100%
get_CreatedByType()-0%100%
get_CreatedAt()-0%100%
get_LastModifiedBy()-0%100%
get_LastModifiedByType()-0%100%
get_LastModifiedAt()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSystemData(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SystemData.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.Resources.Models
 11{
 12    /// <summary> Metadata pertaining to creation and last modification of the resource. </summary>
 13    public partial class SystemData
 14    {
 15        /// <summary> Initializes a new instance of SystemData. </summary>
 016        public SystemData()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of SystemData. </summary>
 21        /// <param name="createdBy"> The identity that created the resource. </param>
 22        /// <param name="createdByType"> The type of identity that created the resource. </param>
 23        /// <param name="createdAt"> The timestamp of resource creation (UTC). </param>
 24        /// <param name="lastModifiedBy"> The identity that last modified the resource. </param>
 25        /// <param name="lastModifiedByType"> The type of identity that last modified the resource. </param>
 26        /// <param name="lastModifiedAt"> The type of identity that last modified the resource. </param>
 7427        internal SystemData(string createdBy, CreatedByType? createdByType, DateTimeOffset? createdAt, string lastModifi
 28        {
 7429            CreatedBy = createdBy;
 7430            CreatedByType = createdByType;
 7431            CreatedAt = createdAt;
 7432            LastModifiedBy = lastModifiedBy;
 7433            LastModifiedByType = lastModifiedByType;
 7434            LastModifiedAt = lastModifiedAt;
 7435        }
 36
 37        /// <summary> The identity that created the resource. </summary>
 038        public string CreatedBy { get; set; }
 39        /// <summary> The type of identity that created the resource. </summary>
 040        public CreatedByType? CreatedByType { get; set; }
 41        /// <summary> The timestamp of resource creation (UTC). </summary>
 042        public DateTimeOffset? CreatedAt { get; set; }
 43        /// <summary> The identity that last modified the resource. </summary>
 044        public string LastModifiedBy { get; set; }
 45        /// <summary> The type of identity that last modified the resource. </summary>
 046        public CreatedByType? LastModifiedByType { get; set; }
 47        /// <summary> The type of identity that last modified the resource. </summary>
 048        public DateTimeOffset? LastModifiedAt { get; set; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SystemData.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;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Resources.Models
 13{
 14    public partial class SystemData : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (CreatedBy != null)
 20            {
 021                writer.WritePropertyName("createdBy");
 022                writer.WriteStringValue(CreatedBy);
 23            }
 024            if (CreatedByType != null)
 25            {
 026                writer.WritePropertyName("createdByType");
 027                writer.WriteStringValue(CreatedByType.Value.ToString());
 28            }
 029            if (CreatedAt != null)
 30            {
 031                writer.WritePropertyName("createdAt");
 032                writer.WriteStringValue(CreatedAt.Value, "O");
 33            }
 034            if (LastModifiedBy != null)
 35            {
 036                writer.WritePropertyName("lastModifiedBy");
 037                writer.WriteStringValue(LastModifiedBy);
 38            }
 039            if (LastModifiedByType != null)
 40            {
 041                writer.WritePropertyName("lastModifiedByType");
 042                writer.WriteStringValue(LastModifiedByType.Value.ToString());
 43            }
 044            if (LastModifiedAt != null)
 45            {
 046                writer.WritePropertyName("lastModifiedAt");
 047                writer.WriteStringValue(LastModifiedAt.Value, "O");
 48            }
 049            writer.WriteEndObject();
 050        }
 51
 52        internal static SystemData DeserializeSystemData(JsonElement element)
 53        {
 7454            string createdBy = default;
 7455            CreatedByType? createdByType = default;
 7456            DateTimeOffset? createdAt = default;
 7457            string lastModifiedBy = default;
 7458            CreatedByType? lastModifiedByType = default;
 7459            DateTimeOffset? lastModifiedAt = default;
 103660            foreach (var property in element.EnumerateObject())
 61            {
 44462                if (property.NameEquals("createdBy"))
 63                {
 7464                    if (property.Value.ValueKind == JsonValueKind.Null)
 65                    {
 66                        continue;
 67                    }
 7468                    createdBy = property.Value.GetString();
 7469                    continue;
 70                }
 37071                if (property.NameEquals("createdByType"))
 72                {
 7473                    if (property.Value.ValueKind == JsonValueKind.Null)
 74                    {
 75                        continue;
 76                    }
 7477                    createdByType = new CreatedByType(property.Value.GetString());
 7478                    continue;
 79                }
 29680                if (property.NameEquals("createdAt"))
 81                {
 7482                    if (property.Value.ValueKind == JsonValueKind.Null)
 83                    {
 84                        continue;
 85                    }
 7486                    createdAt = property.Value.GetDateTimeOffset("O");
 7487                    continue;
 88                }
 22289                if (property.NameEquals("lastModifiedBy"))
 90                {
 7491                    if (property.Value.ValueKind == JsonValueKind.Null)
 92                    {
 93                        continue;
 94                    }
 7495                    lastModifiedBy = property.Value.GetString();
 7496                    continue;
 97                }
 14898                if (property.NameEquals("lastModifiedByType"))
 99                {
 74100                    if (property.Value.ValueKind == JsonValueKind.Null)
 101                    {
 102                        continue;
 103                    }
 74104                    lastModifiedByType = new CreatedByType(property.Value.GetString());
 74105                    continue;
 106                }
 74107                if (property.NameEquals("lastModifiedAt"))
 108                {
 74109                    if (property.Value.ValueKind == JsonValueKind.Null)
 110                    {
 111                        continue;
 112                    }
 74113                    lastModifiedAt = property.Value.GetDateTimeOffset("O");
 114                    continue;
 115                }
 116            }
 74117            return new SystemData(createdBy, createdByType, createdAt, lastModifiedBy, lastModifiedByType, lastModifiedA
 118        }
 119    }
 120}