예제 #1
0
        internal static ManagementPolicyBaseBlob DeserializeManagementPolicyBaseBlob(JsonElement element)
        {
            Optional <DateAfterModification> tierToCool    = default;
            Optional <DateAfterModification> tierToArchive = default;
            Optional <DateAfterModification> delete        = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("tierToCool"))
                {
                    tierToCool = DateAfterModification.DeserializeDateAfterModification(property.Value);
                    continue;
                }
                if (property.NameEquals("tierToArchive"))
                {
                    tierToArchive = DateAfterModification.DeserializeDateAfterModification(property.Value);
                    continue;
                }
                if (property.NameEquals("delete"))
                {
                    delete = DateAfterModification.DeserializeDateAfterModification(property.Value);
                    continue;
                }
            }
            return(new ManagementPolicyBaseBlob(tierToCool.Value, tierToArchive.Value, delete.Value));
        }
예제 #2
0
        internal static ManagementPolicyBaseBlob DeserializeManagementPolicyBaseBlob(JsonElement element)
        {
            Optional <DateAfterModification> tierToCool    = default;
            Optional <DateAfterModification> tierToArchive = default;
            Optional <DateAfterModification> delete        = default;
            Optional <bool> enableAutoTierToHotFromCool    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("tierToCool"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    tierToCool = DateAfterModification.DeserializeDateAfterModification(property.Value);
                    continue;
                }
                if (property.NameEquals("tierToArchive"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    tierToArchive = DateAfterModification.DeserializeDateAfterModification(property.Value);
                    continue;
                }
                if (property.NameEquals("delete"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    delete = DateAfterModification.DeserializeDateAfterModification(property.Value);
                    continue;
                }
                if (property.NameEquals("enableAutoTierToHotFromCool"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    enableAutoTierToHotFromCool = property.Value.GetBoolean();
                    continue;
                }
            }
            return(new ManagementPolicyBaseBlob(tierToCool.Value, tierToArchive.Value, delete.Value, Optional.ToNullable(enableAutoTierToHotFromCool)));
        }
        internal static ManagementPolicyBaseBlob DeserializeManagementPolicyBaseBlob(JsonElement element)
        {
            DateAfterModification tierToCool    = default;
            DateAfterModification tierToArchive = default;
            DateAfterModification delete        = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("tierToCool"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    tierToCool = DateAfterModification.DeserializeDateAfterModification(property.Value);
                    continue;
                }
                if (property.NameEquals("tierToArchive"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    tierToArchive = DateAfterModification.DeserializeDateAfterModification(property.Value);
                    continue;
                }
                if (property.NameEquals("delete"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    delete = DateAfterModification.DeserializeDateAfterModification(property.Value);
                    continue;
                }
            }
            return(new ManagementPolicyBaseBlob(tierToCool, tierToArchive, delete));
        }