< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventData.Serialization.cs
Covered lines:11
Uncovered lines:36
Coverable lines:47
Total lines:120
Line coverage:23.4% (11 of 47)
Covered branches:0
Total branches:16
Branch coverage:0% (0 of 16)

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()-0%100%
get_Request()-100%100%
get_Actor()-100%100%
get_Source()-0%100%
DeserializeContainerRegistryEventData(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventData.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 ContainerRegistryEventData
 14    {
 15        /// <summary> Initializes a new instance of ContainerRegistryEventData. </summary>
 016        internal ContainerRegistryEventData()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ContainerRegistryEventData. </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>
 25        /// <param name="request"> The request that generated the event. </param>
 26        /// <param name="actor"> The agent that initiated the event. For most situations, this could be from the authori
 27        /// <param name="source"> The registry node that generated the event. Put differently, while the actor initiates
 428        internal ContainerRegistryEventData(string id, DateTimeOffset? timestamp, string action, ContainerRegistryEventT
 29        {
 430            Id = id;
 431            Timestamp = timestamp;
 432            Action = action;
 433            Target = target;
 434            Request = request;
 435            Actor = actor;
 436            Source = source;
 437        }
 38
 39        /// <summary> The event ID. </summary>
 040        public string Id { get; }
 41        /// <summary> The time at which the event occurred. </summary>
 042        public DateTimeOffset? Timestamp { get; }
 43        /// <summary> The action that encompasses the provided event. </summary>
 044        public string Action { get; }
 45        /// <summary> The target of the event. </summary>
 046        public ContainerRegistryEventTarget Target { get; }
 47        /// <summary> The request that generated the event. </summary>
 248        public ContainerRegistryEventRequest Request { get; }
 49        /// <summary> The agent that initiated the event. For most situations, this could be from the authorization cont
 250        public ContainerRegistryEventActor Actor { get; }
 51        /// <summary> The registry node that generated the event. Put differently, while the actor initiates the event, 
 052        public ContainerRegistryEventSource Source { get; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventData.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 ContainerRegistryEventData
 15    {
 16        internal static ContainerRegistryEventData DeserializeContainerRegistryEventData(JsonElement element)
 17        {
 018            Optional<string> id = default;
 019            Optional<DateTimeOffset> timestamp = default;
 020            Optional<string> action = default;
 021            Optional<ContainerRegistryEventTarget> target = default;
 022            Optional<ContainerRegistryEventRequest> request = default;
 023            Optional<ContainerRegistryEventActor> actor = default;
 024            Optional<ContainerRegistryEventSource> source = default;
 025            foreach (var property in element.EnumerateObject())
 26            {
 027                if (property.NameEquals("id"))
 28                {
 029                    id = property.Value.GetString();
 030                    continue;
 31                }
 032                if (property.NameEquals("timestamp"))
 33                {
 034                    timestamp = property.Value.GetDateTimeOffset("O");
 035                    continue;
 36                }
 037                if (property.NameEquals("action"))
 38                {
 039                    action = property.Value.GetString();
 040                    continue;
 41                }
 042                if (property.NameEquals("target"))
 43                {
 044                    target = ContainerRegistryEventTarget.DeserializeContainerRegistryEventTarget(property.Value);
 045                    continue;
 46                }
 047                if (property.NameEquals("request"))
 48                {
 049                    request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(property.Value);
 050                    continue;
 51                }
 052                if (property.NameEquals("actor"))
 53                {
 054                    actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(property.Value);
 055                    continue;
 56                }
 057                if (property.NameEquals("source"))
 58                {
 059                    source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(property.Value);
 60                    continue;
 61                }
 62            }
 063            return new ContainerRegistryEventData(id.Value, Optional.ToNullable(timestamp), action.Value, target.Value, 
 64        }
 65    }
 66}