< Summary

Class:Azure.ResourceManager.Network.Models.ServiceEndpointPropertiesFormat
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ServiceEndpointPropertiesFormat.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ServiceEndpointPropertiesFormat.Serialization.cs
Covered lines:0
Uncovered lines:46
Coverable lines:46
Total lines:130
Line coverage:0% (0 of 46)
Covered branches:0
Total branches:26
Branch coverage:0% (0 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Service()-0%100%
get_Locations()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeServiceEndpointPropertiesFormat(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ServiceEndpointPropertiesFormat.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.Collections.Generic;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> The service endpoint properties. </summary>
 13    public partial class ServiceEndpointPropertiesFormat
 14    {
 15        /// <summary> Initializes a new instance of ServiceEndpointPropertiesFormat. </summary>
 016        public ServiceEndpointPropertiesFormat()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ServiceEndpointPropertiesFormat. </summary>
 21        /// <param name="service"> The type of the endpoint service. </param>
 22        /// <param name="locations"> A list of locations. </param>
 23        /// <param name="provisioningState"> The provisioning state of the service endpoint resource. </param>
 024        internal ServiceEndpointPropertiesFormat(string service, IList<string> locations, ProvisioningState? provisionin
 25        {
 026            Service = service;
 027            Locations = locations;
 028            ProvisioningState = provisioningState;
 029        }
 30
 31        /// <summary> The type of the endpoint service. </summary>
 032        public string Service { get; set; }
 33        /// <summary> A list of locations. </summary>
 034        public IList<string> Locations { get; set; }
 35        /// <summary> The provisioning state of the service endpoint resource. </summary>
 036        public ProvisioningState? ProvisioningState { get; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ServiceEndpointPropertiesFormat.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Network.Models
 13{
 14    public partial class ServiceEndpointPropertiesFormat : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Service != null)
 20            {
 021                writer.WritePropertyName("service");
 022                writer.WriteStringValue(Service);
 23            }
 024            if (Locations != null)
 25            {
 026                writer.WritePropertyName("locations");
 027                writer.WriteStartArray();
 028                foreach (var item in Locations)
 29                {
 030                    writer.WriteStringValue(item);
 31                }
 032                writer.WriteEndArray();
 33            }
 034            if (ProvisioningState != null)
 35            {
 036                writer.WritePropertyName("provisioningState");
 037                writer.WriteStringValue(ProvisioningState.Value.ToString());
 38            }
 039            writer.WriteEndObject();
 040        }
 41
 42        internal static ServiceEndpointPropertiesFormat DeserializeServiceEndpointPropertiesFormat(JsonElement element)
 43        {
 044            string service = default;
 045            IList<string> locations = default;
 046            ProvisioningState? provisioningState = default;
 047            foreach (var property in element.EnumerateObject())
 48            {
 049                if (property.NameEquals("service"))
 50                {
 051                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 055                    service = property.Value.GetString();
 056                    continue;
 57                }
 058                if (property.NameEquals("locations"))
 59                {
 060                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 064                    List<string> array = new List<string>();
 065                    foreach (var item in property.Value.EnumerateArray())
 66                    {
 067                        if (item.ValueKind == JsonValueKind.Null)
 68                        {
 069                            array.Add(null);
 70                        }
 71                        else
 72                        {
 073                            array.Add(item.GetString());
 74                        }
 75                    }
 076                    locations = array;
 077                    continue;
 78                }
 079                if (property.NameEquals("provisioningState"))
 80                {
 081                    if (property.Value.ValueKind == JsonValueKind.Null)
 82                    {
 83                        continue;
 84                    }
 085                    provisioningState = new ProvisioningState(property.Value.GetString());
 86                    continue;
 87                }
 88            }
 089            return new ServiceEndpointPropertiesFormat(service, locations, provisioningState);
 90        }
 91    }
 92}