< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryArtifactEventTarget.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryArtifactEventTarget.Serialization.cs
Covered lines:39
Uncovered lines:8
Coverable lines:47
Total lines:117
Line coverage:82.9% (39 of 47)
Covered branches:16
Total branches:16
Branch coverage:100% (16 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_MediaType()-100%100%
get_Size()-0%100%
get_Digest()-0%100%
get_Repository()-0%100%
get_Tag()-0%100%
get_Name()-0%100%
get_Version()-0%100%
DeserializeContainerRegistryArtifactEventTarget(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryArtifactEventTarget.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
 8namespace Azure.Messaging.EventGrid.SystemEvents
 9{
 10    /// <summary> The target of the event. </summary>
 11    public partial class ContainerRegistryArtifactEventTarget
 12    {
 13        /// <summary> Initializes a new instance of ContainerRegistryArtifactEventTarget. </summary>
 014        internal ContainerRegistryArtifactEventTarget()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ContainerRegistryArtifactEventTarget. </summary>
 19        /// <param name="mediaType"> The MIME type of the artifact. </param>
 20        /// <param name="size"> The size in bytes of the artifact. </param>
 21        /// <param name="digest"> The digest of the artifact. </param>
 22        /// <param name="repository"> The repository name of the artifact. </param>
 23        /// <param name="tag"> The tag of the artifact. </param>
 24        /// <param name="name"> The name of the artifact. </param>
 25        /// <param name="version"> The version of the artifact. </param>
 426        internal ContainerRegistryArtifactEventTarget(string mediaType, long? size, string digest, string repository, st
 27        {
 428            MediaType = mediaType;
 429            Size = size;
 430            Digest = digest;
 431            Repository = repository;
 432            Tag = tag;
 433            Name = name;
 434            Version = version;
 435        }
 36
 37        /// <summary> The MIME type of the artifact. </summary>
 438        public string MediaType { get; }
 39        /// <summary> The size in bytes of the artifact. </summary>
 040        public long? Size { get; }
 41        /// <summary> The digest of the artifact. </summary>
 042        public string Digest { get; }
 43        /// <summary> The repository name of the artifact. </summary>
 044        public string Repository { get; }
 45        /// <summary> The tag of the artifact. </summary>
 046        public string Tag { get; }
 47        /// <summary> The name of the artifact. </summary>
 048        public string Name { get; }
 49        /// <summary> The version of the artifact. </summary>
 050        public string Version { get; }
 51    }
 52}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryArtifactEventTarget.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.Messaging.EventGrid.SystemEvents
 12{
 13    public partial class ContainerRegistryArtifactEventTarget
 14    {
 15        internal static ContainerRegistryArtifactEventTarget DeserializeContainerRegistryArtifactEventTarget(JsonElement
 16        {
 417            Optional<string> mediaType = default;
 418            Optional<long> size = default;
 419            Optional<string> digest = default;
 420            Optional<string> repository = default;
 421            Optional<string> tag = default;
 422            Optional<string> name = default;
 423            Optional<string> version = default;
 6424            foreach (var property in element.EnumerateObject())
 25            {
 2826                if (property.NameEquals("mediaType"))
 27                {
 428                    mediaType = property.Value.GetString();
 429                    continue;
 30                }
 2431                if (property.NameEquals("size"))
 32                {
 433                    size = property.Value.GetInt64();
 434                    continue;
 35                }
 2036                if (property.NameEquals("digest"))
 37                {
 438                    digest = property.Value.GetString();
 439                    continue;
 40                }
 1641                if (property.NameEquals("repository"))
 42                {
 443                    repository = property.Value.GetString();
 444                    continue;
 45                }
 1246                if (property.NameEquals("tag"))
 47                {
 448                    tag = property.Value.GetString();
 449                    continue;
 50                }
 851                if (property.NameEquals("name"))
 52                {
 453                    name = property.Value.GetString();
 454                    continue;
 55                }
 456                if (property.NameEquals("version"))
 57                {
 458                    version = property.Value.GetString();
 59                    continue;
 60                }
 61            }
 462            return new ContainerRegistryArtifactEventTarget(mediaType.Value, Optional.ToNullable(size), digest.Value, re
 63        }
 64    }
 65}