< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventTarget.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventTarget.Serialization.cs
Covered lines:38
Uncovered lines:9
Coverable lines:47
Total lines:117
Line coverage:80.8% (38 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()-0%100%
get_Size()-0%100%
get_Digest()-0%100%
get_Length()-0%100%
get_Repository()-0%100%
get_Url()-0%100%
get_Tag()-0%100%
DeserializeContainerRegistryEventTarget(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventTarget.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 ContainerRegistryEventTarget
 12    {
 13        /// <summary> Initializes a new instance of ContainerRegistryEventTarget. </summary>
 014        internal ContainerRegistryEventTarget()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ContainerRegistryEventTarget. </summary>
 19        /// <param name="mediaType"> The MIME type of the referenced object. </param>
 20        /// <param name="size"> The number of bytes of the content. Same as Length field. </param>
 21        /// <param name="digest"> The digest of the content, as defined by the Registry V2 HTTP API Specification. </par
 22        /// <param name="length"> The number of bytes of the content. Same as Size field. </param>
 23        /// <param name="repository"> The repository name. </param>
 24        /// <param name="url"> The direct URL to the content. </param>
 25        /// <param name="tag"> The tag name. </param>
 426        internal ContainerRegistryEventTarget(string mediaType, long? size, string digest, long? length, string reposito
 27        {
 428            MediaType = mediaType;
 429            Size = size;
 430            Digest = digest;
 431            Length = length;
 432            Repository = repository;
 433            Url = url;
 434            Tag = tag;
 435        }
 36
 37        /// <summary> The MIME type of the referenced object. </summary>
 038        public string MediaType { get; }
 39        /// <summary> The number of bytes of the content. Same as Length field. </summary>
 040        public long? Size { get; }
 41        /// <summary> The digest of the content, as defined by the Registry V2 HTTP API Specification. </summary>
 042        public string Digest { get; }
 43        /// <summary> The number of bytes of the content. Same as Size field. </summary>
 044        public long? Length { get; }
 45        /// <summary> The repository name. </summary>
 046        public string Repository { get; }
 47        /// <summary> The direct URL to the content. </summary>
 048        public string Url { get; }
 49        /// <summary> The tag name. </summary>
 050        public string Tag { get; }
 51    }
 52}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventTarget.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 ContainerRegistryEventTarget
 14    {
 15        internal static ContainerRegistryEventTarget DeserializeContainerRegistryEventTarget(JsonElement element)
 16        {
 417            Optional<string> mediaType = default;
 418            Optional<long> size = default;
 419            Optional<string> digest = default;
 420            Optional<long> length = default;
 421            Optional<string> repository = default;
 422            Optional<string> url = default;
 423            Optional<string> tag = 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("length"))
 42                {
 443                    length = property.Value.GetInt64();
 444                    continue;
 45                }
 1246                if (property.NameEquals("repository"))
 47                {
 448                    repository = property.Value.GetString();
 449                    continue;
 50                }
 851                if (property.NameEquals("url"))
 52                {
 453                    url = property.Value.GetString();
 454                    continue;
 55                }
 456                if (property.NameEquals("tag"))
 57                {
 458                    tag = property.Value.GetString();
 59                    continue;
 60                }
 61            }
 462            return new ContainerRegistryEventTarget(mediaType.Value, Optional.ToNullable(size), digest.Value, Optional.T
 63        }
 64    }
 65}