< Summary

Class:Azure.DigitalTwins.Core.IncomingRelationship
Assembly:Azure.DigitalTwins.Core
File(s):C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\IncomingRelationship.cs
C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\IncomingRelationship.Serialization.cs
Covered lines:23
Uncovered lines:6
Coverable lines:29
Total lines:87
Line coverage:79.3% (23 of 29)
Covered branches:10
Total branches:10
Branch coverage:100% (10 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_RelationshipId()-0%100%
get_SourceId()-0%100%
get_RelationshipName()-0%100%
get_RelationshipLink()-0%100%
DeserializeIncomingRelationship(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\IncomingRelationship.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.DigitalTwins.Core
 9{
 10    /// <summary> An incoming relationship. </summary>
 11    public partial class IncomingRelationship
 12    {
 13        /// <summary> Initializes a new instance of IncomingRelationship. </summary>
 014        internal IncomingRelationship()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of IncomingRelationship. </summary>
 19        /// <param name="relationshipId"> A user-provided string representing the id of this relationship, unique in the
 20        /// <param name="sourceId"> The id of the source digital twin. </param>
 21        /// <param name="relationshipName"> The name of the relationship. </param>
 22        /// <param name="relationshipLink"> Link to the relationship, to be used for deletion. </param>
 823        internal IncomingRelationship(string relationshipId, string sourceId, string relationshipName, string relationsh
 24        {
 825            RelationshipId = relationshipId;
 826            SourceId = sourceId;
 827            RelationshipName = relationshipName;
 828            RelationshipLink = relationshipLink;
 829        }
 30
 31        /// <summary> A user-provided string representing the id of this relationship, unique in the context of the sour
 032        public string RelationshipId { get; }
 33        /// <summary> The id of the source digital twin. </summary>
 034        public string SourceId { get; }
 35        /// <summary> The name of the relationship. </summary>
 036        public string RelationshipName { get; }
 37        /// <summary> Link to the relationship, to be used for deletion. </summary>
 038        public string RelationshipLink { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\IncomingRelationship.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.DigitalTwins.Core
 12{
 13    public partial class IncomingRelationship
 14    {
 15        internal static IncomingRelationship DeserializeIncomingRelationship(JsonElement element)
 16        {
 817            Optional<string> relationshipId = default;
 818            Optional<string> sourceId = default;
 819            Optional<string> relationshipName = default;
 820            Optional<string> relationshipLink = default;
 8021            foreach (var property in element.EnumerateObject())
 22            {
 3223                if (property.NameEquals("$relationshipId"))
 24                {
 825                    relationshipId = property.Value.GetString();
 826                    continue;
 27                }
 2428                if (property.NameEquals("$sourceId"))
 29                {
 830                    sourceId = property.Value.GetString();
 831                    continue;
 32                }
 1633                if (property.NameEquals("$relationshipName"))
 34                {
 835                    relationshipName = property.Value.GetString();
 836                    continue;
 37                }
 838                if (property.NameEquals("$relationshipLink"))
 39                {
 840                    relationshipLink = property.Value.GetString();
 41                    continue;
 42                }
 43            }
 844            return new IncomingRelationship(relationshipId.Value, sourceId.Value, relationshipName.Value, relationshipLi
 45        }
 46    }
 47}