< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventRequest.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventRequest.Serialization.cs
Covered lines:29
Uncovered lines:6
Coverable lines:35
Total lines:97
Line coverage:82.8% (29 of 35)
Covered branches:12
Total branches:12
Branch coverage:100% (12 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-0%100%
get_Addr()-100%100%
get_Host()-0%100%
get_Method()-0%100%
get_Useragent()-0%100%
DeserializeContainerRegistryEventRequest(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventRequest.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 request that generated the event. </summary>
 11    public partial class ContainerRegistryEventRequest
 12    {
 13        /// <summary> Initializes a new instance of ContainerRegistryEventRequest. </summary>
 014        internal ContainerRegistryEventRequest()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ContainerRegistryEventRequest. </summary>
 19        /// <param name="id"> The ID of the request that initiated the event. </param>
 20        /// <param name="addr"> The IP or hostname and possibly port of the client connection that initiated the event. 
 21        /// <param name="host"> The externally accessible hostname of the registry instance, as specified by the http ho
 22        /// <param name="method"> The request method that generated the event. </param>
 23        /// <param name="useragent"> The user agent header of the request. </param>
 424        internal ContainerRegistryEventRequest(string id, string addr, string host, string method, string useragent)
 25        {
 426            Id = id;
 427            Addr = addr;
 428            Host = host;
 429            Method = method;
 430            Useragent = useragent;
 431        }
 32
 33        /// <summary> The ID of the request that initiated the event. </summary>
 034        public string Id { get; }
 35        /// <summary> The IP or hostname and possibly port of the client connection that initiated the event. This is th
 236        public string Addr { get; }
 37        /// <summary> The externally accessible hostname of the registry instance, as specified by the http host header 
 038        public string Host { get; }
 39        /// <summary> The request method that generated the event. </summary>
 040        public string Method { get; }
 41        /// <summary> The user agent header of the request. </summary>
 042        public string Useragent { get; }
 43    }
 44}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventRequest.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 ContainerRegistryEventRequest
 14    {
 15        internal static ContainerRegistryEventRequest DeserializeContainerRegistryEventRequest(JsonElement element)
 16        {
 417            Optional<string> id = default;
 418            Optional<string> addr = default;
 419            Optional<string> host = default;
 420            Optional<string> method = default;
 421            Optional<string> useragent = default;
 4822            foreach (var property in element.EnumerateObject())
 23            {
 2024                if (property.NameEquals("id"))
 25                {
 426                    id = property.Value.GetString();
 427                    continue;
 28                }
 1629                if (property.NameEquals("addr"))
 30                {
 431                    addr = property.Value.GetString();
 432                    continue;
 33                }
 1234                if (property.NameEquals("host"))
 35                {
 436                    host = property.Value.GetString();
 437                    continue;
 38                }
 839                if (property.NameEquals("method"))
 40                {
 441                    method = property.Value.GetString();
 442                    continue;
 43                }
 444                if (property.NameEquals("useragent"))
 45                {
 446                    useragent = property.Value.GetString();
 47                    continue;
 48                }
 49            }
 450            return new ContainerRegistryEventRequest(id.Value, addr.Value, host.Value, method.Value, useragent.Value);
 51        }
 52    }
 53}