// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// <auto-generated/>

#nullable disable

using System.Text.Json;
using Azure.Core;

namespace Azure.Management.Network.Models
{
    public partial class Availability
    {
        internal static Availability DeserializeAvailability(JsonElement element)
        {
            string timeGrain = default;
            string retention = default;
            string blobDuration = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("timeGrain"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    timeGrain = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("retention"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    retention = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("blobDuration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    blobDuration = property.Value.GetString();
                    continue;
                }
            }
            return new Availability(timeGrain, retention, blobDuration);
        }
    }
}
