< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_Description()-0%100%
get_Service()-0%100%
get_ServiceResources()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeServiceEndpointPolicyDefinition(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ServiceEndpointPolicyDefinition.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> Service Endpoint policy definitions. </summary>
 13    public partial class ServiceEndpointPolicyDefinition : SubResource
 14    {
 15        /// <summary> Initializes a new instance of ServiceEndpointPolicyDefinition. </summary>
 016        public ServiceEndpointPolicyDefinition()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ServiceEndpointPolicyDefinition. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="description"> A description for this rule. Restricted to 140 chars. </param>
 25        /// <param name="service"> Service endpoint name. </param>
 26        /// <param name="serviceResources"> A list of service resources. </param>
 27        /// <param name="provisioningState"> The provisioning state of the service endpoint policy definition resource. 
 028        internal ServiceEndpointPolicyDefinition(string id, string name, string etag, string description, string service
 29        {
 030            Name = name;
 031            Etag = etag;
 032            Description = description;
 033            Service = service;
 034            ServiceResources = serviceResources;
 035            ProvisioningState = provisioningState;
 036        }
 37
 38        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 039        public string Name { get; set; }
 40        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 041        public string Etag { get; }
 42        /// <summary> A description for this rule. Restricted to 140 chars. </summary>
 043        public string Description { get; set; }
 44        /// <summary> Service endpoint name. </summary>
 045        public string Service { get; set; }
 46        /// <summary> A list of service resources. </summary>
 047        public IList<string> ServiceResources { get; set; }
 48        /// <summary> The provisioning state of the service endpoint policy definition resource. </summary>
 049        public ProvisioningState? ProvisioningState { get; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ServiceEndpointPolicyDefinition.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 ServiceEndpointPolicyDefinition : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (Etag != null)
 25            {
 026                writer.WritePropertyName("etag");
 027                writer.WriteStringValue(Etag);
 28            }
 029            if (Id != null)
 30            {
 031                writer.WritePropertyName("id");
 032                writer.WriteStringValue(Id);
 33            }
 034            writer.WritePropertyName("properties");
 035            writer.WriteStartObject();
 036            if (Description != null)
 37            {
 038                writer.WritePropertyName("description");
 039                writer.WriteStringValue(Description);
 40            }
 041            if (Service != null)
 42            {
 043                writer.WritePropertyName("service");
 044                writer.WriteStringValue(Service);
 45            }
 046            if (ServiceResources != null)
 47            {
 048                writer.WritePropertyName("serviceResources");
 049                writer.WriteStartArray();
 050                foreach (var item in ServiceResources)
 51                {
 052                    writer.WriteStringValue(item);
 53                }
 054                writer.WriteEndArray();
 55            }
 056            if (ProvisioningState != null)
 57            {
 058                writer.WritePropertyName("provisioningState");
 059                writer.WriteStringValue(ProvisioningState.Value.ToString());
 60            }
 061            writer.WriteEndObject();
 062            writer.WriteEndObject();
 063        }
 64
 65        internal static ServiceEndpointPolicyDefinition DeserializeServiceEndpointPolicyDefinition(JsonElement element)
 66        {
 067            string name = default;
 068            string etag = default;
 069            string id = default;
 070            string description = default;
 071            string service = default;
 072            IList<string> serviceResources = default;
 073            ProvisioningState? provisioningState = default;
 074            foreach (var property in element.EnumerateObject())
 75            {
 076                if (property.NameEquals("name"))
 77                {
 078                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 082                    name = property.Value.GetString();
 083                    continue;
 84                }
 085                if (property.NameEquals("etag"))
 86                {
 087                    if (property.Value.ValueKind == JsonValueKind.Null)
 88                    {
 89                        continue;
 90                    }
 091                    etag = property.Value.GetString();
 092                    continue;
 93                }
 094                if (property.NameEquals("id"))
 95                {
 096                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 0100                    id = property.Value.GetString();
 0101                    continue;
 102                }
 0103                if (property.NameEquals("properties"))
 104                {
 0105                    foreach (var property0 in property.Value.EnumerateObject())
 106                    {
 0107                        if (property0.NameEquals("description"))
 108                        {
 0109                            if (property0.Value.ValueKind == JsonValueKind.Null)
 110                            {
 111                                continue;
 112                            }
 0113                            description = property0.Value.GetString();
 0114                            continue;
 115                        }
 0116                        if (property0.NameEquals("service"))
 117                        {
 0118                            if (property0.Value.ValueKind == JsonValueKind.Null)
 119                            {
 120                                continue;
 121                            }
 0122                            service = property0.Value.GetString();
 0123                            continue;
 124                        }
 0125                        if (property0.NameEquals("serviceResources"))
 126                        {
 0127                            if (property0.Value.ValueKind == JsonValueKind.Null)
 128                            {
 129                                continue;
 130                            }
 0131                            List<string> array = new List<string>();
 0132                            foreach (var item in property0.Value.EnumerateArray())
 133                            {
 0134                                if (item.ValueKind == JsonValueKind.Null)
 135                                {
 0136                                    array.Add(null);
 137                                }
 138                                else
 139                                {
 0140                                    array.Add(item.GetString());
 141                                }
 142                            }
 0143                            serviceResources = array;
 0144                            continue;
 145                        }
 0146                        if (property0.NameEquals("provisioningState"))
 147                        {
 0148                            if (property0.Value.ValueKind == JsonValueKind.Null)
 149                            {
 150                                continue;
 151                            }
 0152                            provisioningState = new ProvisioningState(property0.Value.GetString());
 153                            continue;
 154                        }
 155                    }
 156                    continue;
 157                }
 158            }
 0159            return new ServiceEndpointPolicyDefinition(id, name, etag, description, service, serviceResources, provision
 160        }
 161    }
 162}