< Summary

Class:Azure.Security.KeyVault.Administration.Models.RestoreDetailsInternal
Assembly:Azure.Security.KeyVault.Administration
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RestoreDetailsInternal.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RestoreDetailsInternal.Serialization.cs
Covered lines:41
Uncovered lines:6
Coverable lines:47
Total lines:120
Line coverage:87.2% (41 of 47)
Covered branches:18
Total branches:18
Branch coverage:100% (18 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Status()-0%100%
get_StatusDetails()-0%100%
get_Error()-100%100%
get_JobId()-0%100%
get_StartTime()-0%100%
get_EndTime()-100%100%
DeserializeRestoreDetailsInternal(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RestoreDetailsInternal.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;
 9
 10namespace Azure.Security.KeyVault.Administration.Models
 11{
 12    /// <summary> Restore operation. </summary>
 13    internal partial class RestoreDetailsInternal
 14    {
 15        /// <summary> Initializes a new instance of RestoreDetailsInternal. </summary>
 016        internal RestoreDetailsInternal()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of RestoreDetailsInternal. </summary>
 21        /// <param name="status"> Status of the restore operation. </param>
 22        /// <param name="statusDetails"> The status details of restore operation. </param>
 23        /// <param name="error"> Error encountered, if any, during the restore operation. </param>
 24        /// <param name="jobId"> Identifier for the restore operation. </param>
 25        /// <param name="startTime"> The start time of the restore operation. </param>
 26        /// <param name="endTime"> The end time of the restore operation in UTC. </param>
 1227        internal RestoreDetailsInternal(string status, string statusDetails, KeyVaultServiceError error, string jobId, D
 28        {
 1229            Status = status;
 1230            StatusDetails = statusDetails;
 1231            Error = error;
 1232            JobId = jobId;
 1233            StartTime = startTime;
 1234            EndTime = endTime;
 1235        }
 36
 37        /// <summary> Status of the restore operation. </summary>
 038        public string Status { get; }
 39        /// <summary> The status details of restore operation. </summary>
 040        public string StatusDetails { get; }
 41        /// <summary> Error encountered, if any, during the restore operation. </summary>
 842        public KeyVaultServiceError Error { get; }
 43        /// <summary> Identifier for the restore operation. </summary>
 044        public string JobId { get; }
 45        /// <summary> The start time of the restore operation. </summary>
 046        public DateTimeOffset? StartTime { get; }
 47        /// <summary> The end time of the restore operation in UTC. </summary>
 3248        public DateTimeOffset? EndTime { get; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RestoreDetailsInternal.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.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Security.KeyVault.Administration.Models
 13{
 14    internal partial class RestoreDetailsInternal
 15    {
 16        internal static RestoreDetailsInternal DeserializeRestoreDetailsInternal(JsonElement element)
 17        {
 1218            Optional<string> status = default;
 1219            Optional<string> statusDetails = default;
 1220            Optional<KeyVaultServiceError> error = default;
 1221            Optional<string> jobId = default;
 1222            Optional<DateTimeOffset> startTime = default;
 1223            Optional<DateTimeOffset?> endTime = default;
 16824            foreach (var property in element.EnumerateObject())
 25            {
 7226                if (property.NameEquals("status"))
 27                {
 1228                    status = property.Value.GetString();
 1229                    continue;
 30                }
 6031                if (property.NameEquals("statusDetails"))
 32                {
 1233                    statusDetails = property.Value.GetString();
 1234                    continue;
 35                }
 4836                if (property.NameEquals("error"))
 37                {
 1238                    if (property.Value.ValueKind == JsonValueKind.Null)
 39                    {
 440                        error = null;
 441                        continue;
 42                    }
 843                    error = KeyVaultServiceError.DeserializeKeyVaultServiceError(property.Value);
 844                    continue;
 45                }
 3646                if (property.NameEquals("jobId"))
 47                {
 1248                    jobId = property.Value.GetString();
 1249                    continue;
 50                }
 2451                if (property.NameEquals("startTime"))
 52                {
 1253                    startTime = property.Value.GetDateTimeOffset("U");
 1254                    continue;
 55                }
 1256                if (property.NameEquals("endTime"))
 57                {
 1258                    if (property.Value.ValueKind == JsonValueKind.Null)
 59                    {
 860                        endTime = null;
 861                        continue;
 62                    }
 463                    endTime = property.Value.GetDateTimeOffset("U");
 64                    continue;
 65                }
 66            }
 1267            return new RestoreDetailsInternal(status.Value, statusDetails.Value, error.Value, jobId.Value, Optional.ToNu
 68        }
 69    }
 70}