< Summary

Class:Azure.ResourceManager.DigitalTwins.Models.DigitalTwinsEndpointResourceProperties
Assembly:Azure.ResourceManager.DigitalTwins
File(s):C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\DigitalTwinsEndpointResourceProperties.cs
C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\DigitalTwinsEndpointResourceProperties.Serialization.cs
Covered lines:0
Uncovered lines:50
Coverable lines:50
Total lines:127
Line coverage:0% (0 of 50)
Covered branches:0
Total branches:24
Branch coverage:0% (0 of 24)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_EndpointType()-0%100%
get_ProvisioningState()-0%100%
get_CreatedTime()-0%100%
get_Tags()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeDigitalTwinsEndpointResourceProperties(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\DigitalTwinsEndpointResourceProperties.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.Collections.Generic;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.DigitalTwins.Models
 13{
 14    /// <summary> Properties related to Digital Twins Endpoint. </summary>
 15    public partial class DigitalTwinsEndpointResourceProperties
 16    {
 17        /// <summary> Initializes a new instance of DigitalTwinsEndpointResourceProperties. </summary>
 018        public DigitalTwinsEndpointResourceProperties()
 19        {
 020            Tags = new ChangeTrackingDictionary<string, string>();
 021        }
 22
 23        /// <summary> Initializes a new instance of DigitalTwinsEndpointResourceProperties. </summary>
 24        /// <param name="endpointType"> The type of Digital Twins endpoint. </param>
 25        /// <param name="provisioningState"> The provisioning state. </param>
 26        /// <param name="createdTime"> Time when the Endpoint was added to DigitalTwinsInstance. </param>
 27        /// <param name="tags"> The resource tags. </param>
 028        internal DigitalTwinsEndpointResourceProperties(EndpointType endpointType, EndpointProvisioningState? provisioni
 29        {
 030            EndpointType = endpointType;
 031            ProvisioningState = provisioningState;
 032            CreatedTime = createdTime;
 033            Tags = tags;
 034        }
 35
 36        /// <summary> The type of Digital Twins endpoint. </summary>
 037        internal EndpointType EndpointType { get; set; }
 38        /// <summary> The provisioning state. </summary>
 039        public EndpointProvisioningState? ProvisioningState { get; }
 40        /// <summary> Time when the Endpoint was added to DigitalTwinsInstance. </summary>
 041        public DateTimeOffset? CreatedTime { get; }
 42        /// <summary> The resource tags. </summary>
 043        public IDictionary<string, string> Tags { get; }
 44    }
 45}

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\DigitalTwinsEndpointResourceProperties.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.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.ResourceManager.DigitalTwins.Models
 14{
 15    public partial class DigitalTwinsEndpointResourceProperties : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 019            writer.WriteStartObject();
 020            writer.WritePropertyName("endpointType");
 021            writer.WriteStringValue(EndpointType.ToString());
 022            if (Optional.IsCollectionDefined(Tags))
 23            {
 024                writer.WritePropertyName("tags");
 025                writer.WriteStartObject();
 026                foreach (var item in Tags)
 27                {
 028                    writer.WritePropertyName(item.Key);
 029                    writer.WriteStringValue(item.Value);
 30                }
 031                writer.WriteEndObject();
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static DigitalTwinsEndpointResourceProperties DeserializeDigitalTwinsEndpointResourceProperties(JsonEle
 37        {
 038            if (element.TryGetProperty("endpointType", out JsonElement discriminator))
 39            {
 040                switch (discriminator.GetString())
 41                {
 042                    case "EventGrid": return EventGrid.DeserializeEventGrid(element);
 043                    case "EventHub": return EventHub.DeserializeEventHub(element);
 044                    case "ServiceBus": return ServiceBus.DeserializeServiceBus(element);
 45                }
 46            }
 047            EndpointType endpointType = default;
 048            Optional<EndpointProvisioningState> provisioningState = default;
 049            Optional<DateTimeOffset> createdTime = default;
 050            Optional<IDictionary<string, string>> tags = default;
 051            foreach (var property in element.EnumerateObject())
 52            {
 053                if (property.NameEquals("endpointType"))
 54                {
 055                    endpointType = new EndpointType(property.Value.GetString());
 056                    continue;
 57                }
 058                if (property.NameEquals("provisioningState"))
 59                {
 060                    provisioningState = new EndpointProvisioningState(property.Value.GetString());
 061                    continue;
 62                }
 063                if (property.NameEquals("createdTime"))
 64                {
 065                    createdTime = property.Value.GetDateTimeOffset("O");
 066                    continue;
 67                }
 068                if (property.NameEquals("tags"))
 69                {
 070                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 071                    foreach (var property0 in property.Value.EnumerateObject())
 72                    {
 073                        dictionary.Add(property0.Name, property0.Value.GetString());
 74                    }
 075                    tags = dictionary;
 76                    continue;
 77                }
 78            }
 079            return new DigitalTwinsEndpointResourceProperties(endpointType, Optional.ToNullable(provisioningState), Opti
 80        }
 81    }
 82}