< Summary

Class:Azure.ResourceManager.Compute.Models.GalleryApplicationVersionPublishingProfile
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplicationVersionPublishingProfile.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplicationVersionPublishingProfile.Serialization.cs
Covered lines:0
Uncovered lines:95
Coverable lines:95
Total lines:228
Line coverage:0% (0 of 95)
Covered branches:0
Total branches:60
Branch coverage:0% (0 of 60)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Source()-0%100%
get_ContentType()-0%100%
get_EnableHealthCheck()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeGalleryApplicationVersionPublishingProfile(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplicationVersionPublishingProfile.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;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    /// <summary> The publishing profile of a gallery Image Version. </summary>
 14    public partial class GalleryApplicationVersionPublishingProfile : GalleryArtifactPublishingProfileBase
 15    {
 16        /// <summary> Initializes a new instance of GalleryApplicationVersionPublishingProfile. </summary>
 17        /// <param name="source"> The source image from which the Image Version is going to be created. </param>
 018        public GalleryApplicationVersionPublishingProfile(UserArtifactSource source)
 19        {
 020            if (source == null)
 21            {
 022                throw new ArgumentNullException(nameof(source));
 23            }
 24
 025            Source = source;
 026        }
 27
 28        /// <summary> Initializes a new instance of GalleryApplicationVersionPublishingProfile. </summary>
 29        /// <param name="targetRegions"> The target regions where the Image Version is going to be replicated to. This p
 30        /// <param name="replicaCount"> The number of replicas of the Image Version to be created per region. This prope
 31        /// <param name="excludeFromLatest"> If set to true, Virtual Machines deployed from the latest version of the Im
 32        /// <param name="publishedDate"> The timestamp for when the gallery Image Version is published. </param>
 33        /// <param name="endOfLifeDate"> The end of life date of the gallery Image Version. This property can be used fo
 34        /// <param name="storageAccountType"> Specifies the storage account type to be used to store the image. This pro
 35        /// <param name="source"> The source image from which the Image Version is going to be created. </param>
 36        /// <param name="contentType"> Optional. May be used to help process this file. The type of file contained in th
 37        /// <param name="enableHealthCheck"> Optional. Whether or not this application reports health. </param>
 038        internal GalleryApplicationVersionPublishingProfile(IList<TargetRegion> targetRegions, int? replicaCount, bool? 
 39        {
 040            Source = source;
 041            ContentType = contentType;
 042            EnableHealthCheck = enableHealthCheck;
 043        }
 44
 45        /// <summary> The source image from which the Image Version is going to be created. </summary>
 046        public UserArtifactSource Source { get; set; }
 47        /// <summary> Optional. May be used to help process this file. The type of file contained in the source, e.g. zi
 048        public string ContentType { get; set; }
 49        /// <summary> Optional. Whether or not this application reports health. </summary>
 050        public bool? EnableHealthCheck { get; set; }
 51    }
 52}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryApplicationVersionPublishingProfile.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.Compute.Models
 14{
 15    public partial class GalleryApplicationVersionPublishingProfile : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 019            writer.WriteStartObject();
 020            writer.WritePropertyName("source");
 021            writer.WriteObjectValue(Source);
 022            if (ContentType != null)
 23            {
 024                writer.WritePropertyName("contentType");
 025                writer.WriteStringValue(ContentType);
 26            }
 027            if (EnableHealthCheck != null)
 28            {
 029                writer.WritePropertyName("enableHealthCheck");
 030                writer.WriteBooleanValue(EnableHealthCheck.Value);
 31            }
 032            if (TargetRegions != null)
 33            {
 034                writer.WritePropertyName("targetRegions");
 035                writer.WriteStartArray();
 036                foreach (var item in TargetRegions)
 37                {
 038                    writer.WriteObjectValue(item);
 39                }
 040                writer.WriteEndArray();
 41            }
 042            if (ReplicaCount != null)
 43            {
 044                writer.WritePropertyName("replicaCount");
 045                writer.WriteNumberValue(ReplicaCount.Value);
 46            }
 047            if (ExcludeFromLatest != null)
 48            {
 049                writer.WritePropertyName("excludeFromLatest");
 050                writer.WriteBooleanValue(ExcludeFromLatest.Value);
 51            }
 052            if (PublishedDate != null)
 53            {
 054                writer.WritePropertyName("publishedDate");
 055                writer.WriteStringValue(PublishedDate.Value, "O");
 56            }
 057            if (EndOfLifeDate != null)
 58            {
 059                writer.WritePropertyName("endOfLifeDate");
 060                writer.WriteStringValue(EndOfLifeDate.Value, "O");
 61            }
 062            if (StorageAccountType != null)
 63            {
 064                writer.WritePropertyName("storageAccountType");
 065                writer.WriteStringValue(StorageAccountType.Value.ToString());
 66            }
 067            writer.WriteEndObject();
 068        }
 69
 70        internal static GalleryApplicationVersionPublishingProfile DeserializeGalleryApplicationVersionPublishingProfile
 71        {
 072            UserArtifactSource source = default;
 073            string contentType = default;
 074            bool? enableHealthCheck = default;
 075            IList<TargetRegion> targetRegions = default;
 076            int? replicaCount = default;
 077            bool? excludeFromLatest = default;
 078            DateTimeOffset? publishedDate = default;
 079            DateTimeOffset? endOfLifeDate = default;
 080            StorageAccountType? storageAccountType = default;
 081            foreach (var property in element.EnumerateObject())
 82            {
 083                if (property.NameEquals("source"))
 84                {
 085                    source = UserArtifactSource.DeserializeUserArtifactSource(property.Value);
 086                    continue;
 87                }
 088                if (property.NameEquals("contentType"))
 89                {
 090                    if (property.Value.ValueKind == JsonValueKind.Null)
 91                    {
 92                        continue;
 93                    }
 094                    contentType = property.Value.GetString();
 095                    continue;
 96                }
 097                if (property.NameEquals("enableHealthCheck"))
 98                {
 099                    if (property.Value.ValueKind == JsonValueKind.Null)
 100                    {
 101                        continue;
 102                    }
 0103                    enableHealthCheck = property.Value.GetBoolean();
 0104                    continue;
 105                }
 0106                if (property.NameEquals("targetRegions"))
 107                {
 0108                    if (property.Value.ValueKind == JsonValueKind.Null)
 109                    {
 110                        continue;
 111                    }
 0112                    List<TargetRegion> array = new List<TargetRegion>();
 0113                    foreach (var item in property.Value.EnumerateArray())
 114                    {
 0115                        if (item.ValueKind == JsonValueKind.Null)
 116                        {
 0117                            array.Add(null);
 118                        }
 119                        else
 120                        {
 0121                            array.Add(TargetRegion.DeserializeTargetRegion(item));
 122                        }
 123                    }
 0124                    targetRegions = array;
 0125                    continue;
 126                }
 0127                if (property.NameEquals("replicaCount"))
 128                {
 0129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 0133                    replicaCount = property.Value.GetInt32();
 0134                    continue;
 135                }
 0136                if (property.NameEquals("excludeFromLatest"))
 137                {
 0138                    if (property.Value.ValueKind == JsonValueKind.Null)
 139                    {
 140                        continue;
 141                    }
 0142                    excludeFromLatest = property.Value.GetBoolean();
 0143                    continue;
 144                }
 0145                if (property.NameEquals("publishedDate"))
 146                {
 0147                    if (property.Value.ValueKind == JsonValueKind.Null)
 148                    {
 149                        continue;
 150                    }
 0151                    publishedDate = property.Value.GetDateTimeOffset("O");
 0152                    continue;
 153                }
 0154                if (property.NameEquals("endOfLifeDate"))
 155                {
 0156                    if (property.Value.ValueKind == JsonValueKind.Null)
 157                    {
 158                        continue;
 159                    }
 0160                    endOfLifeDate = property.Value.GetDateTimeOffset("O");
 0161                    continue;
 162                }
 0163                if (property.NameEquals("storageAccountType"))
 164                {
 0165                    if (property.Value.ValueKind == JsonValueKind.Null)
 166                    {
 167                        continue;
 168                    }
 0169                    storageAccountType = new StorageAccountType(property.Value.GetString());
 170                    continue;
 171                }
 172            }
 0173            return new GalleryApplicationVersionPublishingProfile(targetRegions, replicaCount, excludeFromLatest, publis
 174        }
 175    }
 176}