< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryArtifactEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryArtifactEventData.Serialization.cs
Covered lines:7
Uncovered lines:22
Coverable lines:29
Total lines:90
Line coverage:24.1% (7 of 29)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-0%100%
get_Timestamp()-0%100%
get_Action()-0%100%
get_Target()-100%100%
DeserializeContainerRegistryArtifactEventData(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryArtifactEventData.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.Messaging.EventGrid.SystemEvents
 11{
 12    /// <summary> The content of the event request message. </summary>
 13    public partial class ContainerRegistryArtifactEventData
 14    {
 15        /// <summary> Initializes a new instance of ContainerRegistryArtifactEventData. </summary>
 016        internal ContainerRegistryArtifactEventData()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ContainerRegistryArtifactEventData. </summary>
 21        /// <param name="id"> The event ID. </param>
 22        /// <param name="timestamp"> The time at which the event occurred. </param>
 23        /// <param name="action"> The action that encompasses the provided event. </param>
 24        /// <param name="target"> The target of the event. </param>
 425        internal ContainerRegistryArtifactEventData(string id, DateTimeOffset? timestamp, string action, ContainerRegist
 26        {
 427            Id = id;
 428            Timestamp = timestamp;
 429            Action = action;
 430            Target = target;
 431        }
 32
 33        /// <summary> The event ID. </summary>
 034        public string Id { get; }
 35        /// <summary> The time at which the event occurred. </summary>
 036        public DateTimeOffset? Timestamp { get; }
 37        /// <summary> The action that encompasses the provided event. </summary>
 038        public string Action { get; }
 39        /// <summary> The target of the event. </summary>
 440        public ContainerRegistryArtifactEventTarget Target { get; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryArtifactEventData.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.Messaging.EventGrid.SystemEvents
 13{
 14    public partial class ContainerRegistryArtifactEventData
 15    {
 16        internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryArtifactEventData(JsonElement ele
 17        {
 018            Optional<string> id = default;
 019            Optional<DateTimeOffset> timestamp = default;
 020            Optional<string> action = default;
 021            Optional<ContainerRegistryArtifactEventTarget> target = default;
 022            foreach (var property in element.EnumerateObject())
 23            {
 024                if (property.NameEquals("id"))
 25                {
 026                    id = property.Value.GetString();
 027                    continue;
 28                }
 029                if (property.NameEquals("timestamp"))
 30                {
 031                    timestamp = property.Value.GetDateTimeOffset("O");
 032                    continue;
 33                }
 034                if (property.NameEquals("action"))
 35                {
 036                    action = property.Value.GetString();
 037                    continue;
 38                }
 039                if (property.NameEquals("target"))
 40                {
 041                    target = ContainerRegistryArtifactEventTarget.DeserializeContainerRegistryArtifactEventTarget(proper
 42                    continue;
 43                }
 44            }
 045            return new ContainerRegistryArtifactEventData(id.Value, Optional.ToNullable(timestamp), action.Value, target
 46        }
 47    }
 48}