< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\SubscriptionValidationEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\SubscriptionValidationEventData.Serialization.cs
Covered lines:14
Uncovered lines:3
Coverable lines:17
Total lines:67
Line coverage:82.3% (14 of 17)
Covered branches:6
Total branches:6
Branch coverage:100% (6 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_ValidationCode()-100%100%
get_ValidationUrl()-0%100%
DeserializeSubscriptionValidationEventData(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\SubscriptionValidationEventData.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> Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent
 11    public partial class SubscriptionValidationEventData
 12    {
 13        /// <summary> Initializes a new instance of SubscriptionValidationEventData. </summary>
 014        internal SubscriptionValidationEventData()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of SubscriptionValidationEventData. </summary>
 19        /// <param name="validationCode"> The validation code sent by Azure Event Grid to validate an event subscription
 20        /// <param name="validationUrl"> The validation URL sent by Azure Event Grid (available starting version 2018-05
 221        internal SubscriptionValidationEventData(string validationCode, string validationUrl)
 22        {
 223            ValidationCode = validationCode;
 224            ValidationUrl = validationUrl;
 225        }
 26
 27        /// <summary> The validation code sent by Azure Event Grid to validate an event subscription. To complete the va
 228        public string ValidationCode { get; }
 29        /// <summary> The validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). To co
 030        public string ValidationUrl { get; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\SubscriptionValidationEventData.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 SubscriptionValidationEventData
 14    {
 15        internal static SubscriptionValidationEventData DeserializeSubscriptionValidationEventData(JsonElement element)
 16        {
 217            Optional<string> validationCode = default;
 218            Optional<string> validationUrl = default;
 1219            foreach (var property in element.EnumerateObject())
 20            {
 421                if (property.NameEquals("validationCode"))
 22                {
 223                    validationCode = property.Value.GetString();
 224                    continue;
 25                }
 226                if (property.NameEquals("validationUrl"))
 27                {
 228                    validationUrl = property.Value.GetString();
 29                    continue;
 30                }
 31            }
 232            return new SubscriptionValidationEventData(validationCode.Value, validationUrl.Value);
 33        }
 34    }
 35}