Пример #1
0
 internal DiskData(ResourceIdentifier id, string name, ResourceType type, IDictionary <string, string> tags, AzureLocation location, string managedBy, IReadOnlyList <string> managedByExtended, DiskSku sku, IList <string> zones, ExtendedLocation extendedLocation, DateTimeOffset?timeCreated, OperatingSystemTypes?osType, HyperVGeneration?hyperVGeneration, PurchasePlanAutoGenerated purchasePlan, CreationData creationData, int?diskSizeGB, long?diskSizeBytes, string uniqueId, EncryptionSettingsCollection encryptionSettingsCollection, string provisioningState, long?diskIopsReadWrite, long?diskMBpsReadWrite, long?diskIopsReadOnly, long?diskMBpsReadOnly, DiskState?diskState, Encryption encryption, int?maxShares, IReadOnlyList <ShareInfoElement> shareInfo, NetworkAccessPolicy?networkAccessPolicy, string diskAccessId, string tier, bool?burstingEnabled, PropertyUpdatesInProgress propertyUpdatesInProgress, bool?supportsHibernation, DiskSecurityProfile securityProfile) : base(id, name, type, tags, location)
 {
     ManagedBy         = managedBy;
     ManagedByExtended = managedByExtended;
     Sku                          = sku;
     Zones                        = zones;
     ExtendedLocation             = extendedLocation;
     TimeCreated                  = timeCreated;
     OsType                       = osType;
     HyperVGeneration             = hyperVGeneration;
     PurchasePlan                 = purchasePlan;
     CreationData                 = creationData;
     DiskSizeGB                   = diskSizeGB;
     DiskSizeBytes                = diskSizeBytes;
     UniqueId                     = uniqueId;
     EncryptionSettingsCollection = encryptionSettingsCollection;
     ProvisioningState            = provisioningState;
     DiskIopsReadWrite            = diskIopsReadWrite;
     DiskMBpsReadWrite            = diskMBpsReadWrite;
     DiskIopsReadOnly             = diskIopsReadOnly;
     DiskMBpsReadOnly             = diskMBpsReadOnly;
     DiskState                    = diskState;
     Encryption                   = encryption;
     MaxShares                    = maxShares;
     ShareInfo                    = shareInfo;
     NetworkAccessPolicy          = networkAccessPolicy;
     DiskAccessId                 = diskAccessId;
     Tier                         = tier;
     BurstingEnabled              = burstingEnabled;
     PropertyUpdatesInProgress    = propertyUpdatesInProgress;
     SupportsHibernation          = supportsHibernation;
     SecurityProfile              = securityProfile;
 }
 internal DiskRestorePointData(ResourceIdentifier id, string name, ResourceType type, DateTimeOffset?timeCreated, string sourceResourceId, OperatingSystemTypes?osType, HyperVGeneration?hyperVGeneration, PurchasePlanAutoGenerated purchasePlan, string familyId, string sourceUniqueId, Encryption encryption, bool?supportsHibernation) : base(id, name, type)
 {
     TimeCreated         = timeCreated;
     SourceResourceId    = sourceResourceId;
     OsType              = osType;
     HyperVGeneration    = hyperVGeneration;
     PurchasePlan        = purchasePlan;
     FamilyId            = familyId;
     SourceUniqueId      = sourceUniqueId;
     Encryption          = encryption;
     SupportsHibernation = supportsHibernation;
 }
Пример #3
0
 internal SnapshotData(ResourceIdentifier id, string name, ResourceType type, IDictionary <string, string> tags, Location location, string managedBy, SnapshotSku sku, ExtendedLocation extendedLocation, DateTimeOffset?timeCreated, OperatingSystemTypes?osType, HyperVGeneration?hyperVGeneration, PurchasePlanAutoGenerated purchasePlan, CreationData creationData, int?diskSizeGB, long?diskSizeBytes, DiskState?diskState, string uniqueId, EncryptionSettingsCollection encryptionSettingsCollection, string provisioningState, bool?incremental, Encryption encryption, NetworkAccessPolicy?networkAccessPolicy, string diskAccessId, bool?supportsHibernation) : base(id, name, type, tags, location)
 {
     ManagedBy                    = managedBy;
     Sku                          = sku;
     ExtendedLocation             = extendedLocation;
     TimeCreated                  = timeCreated;
     OsType                       = osType;
     HyperVGeneration             = hyperVGeneration;
     PurchasePlan                 = purchasePlan;
     CreationData                 = creationData;
     DiskSizeGB                   = diskSizeGB;
     DiskSizeBytes                = diskSizeBytes;
     DiskState                    = diskState;
     UniqueId                     = uniqueId;
     EncryptionSettingsCollection = encryptionSettingsCollection;
     ProvisioningState            = provisioningState;
     Incremental                  = incremental;
     Encryption                   = encryption;
     NetworkAccessPolicy          = networkAccessPolicy;
     DiskAccessId                 = diskAccessId;
     SupportsHibernation          = supportsHibernation;
 }
Пример #4
0
        internal static DiskData DeserializeDiskData(JsonElement element)
        {
            Optional <string> managedBy = default;
            Optional <IReadOnlyList <string> > managedByExtended = default;
            Optional <DiskSku>           sku                                          = default;
            Optional <IList <string> >   zones                                        = default;
            Optional <ExtendedLocation>  extendedLocation                             = default;
            IDictionary <string, string> tags                                         = default;
            AzureLocation                                location                     = default;
            ResourceIdentifier                           id                           = default;
            string                                       name                         = default;
            ResourceType                                 type                         = default;
            Optional <DateTimeOffset>                    timeCreated                  = default;
            Optional <OperatingSystemTypes>              osType                       = default;
            Optional <HyperVGeneration>                  hyperVGeneration             = default;
            Optional <PurchasePlanAutoGenerated>         purchasePlan                 = default;
            Optional <CreationData>                      creationData                 = default;
            Optional <int>                               diskSizeGB                   = default;
            Optional <long>                              diskSizeBytes                = default;
            Optional <string>                            uniqueId                     = default;
            Optional <EncryptionSettingsCollection>      encryptionSettingsCollection = default;
            Optional <string>                            provisioningState            = default;
            Optional <long>                              diskIOPSReadWrite            = default;
            Optional <long>                              diskMBpsReadWrite            = default;
            Optional <long>                              diskIOPSReadOnly             = default;
            Optional <long>                              diskMBpsReadOnly             = default;
            Optional <DiskState>                         diskState                    = default;
            Optional <Encryption>                        encryption                   = default;
            Optional <int>                               maxShares                    = default;
            Optional <IReadOnlyList <ShareInfoElement> > shareInfo                    = default;
            Optional <NetworkAccessPolicy>               networkAccessPolicy          = default;
            Optional <string>                            diskAccessId                 = default;
            Optional <string>                            tier                         = default;
            Optional <bool>                              burstingEnabled              = default;
            Optional <PropertyUpdatesInProgress>         propertyUpdatesInProgress    = default;
            Optional <bool>                              supportsHibernation          = default;
            Optional <DiskSecurityProfile>               securityProfile              = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("managedBy"))
                {
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("managedByExtended"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <string> array = new List <string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.GetString());
                    }
                    managedByExtended = array;
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = DiskSku.DeserializeDiskSku(property.Value);
                    continue;
                }
                if (property.NameEquals("zones"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <string> array = new List <string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.GetString());
                    }
                    zones = array;
                    continue;
                }
                if (property.NameEquals("extendedLocation"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("timeCreated"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            timeCreated = property0.Value.GetDateTimeOffset("O");
                            continue;
                        }
                        if (property0.NameEquals("osType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            osType = property0.Value.GetString().ToOperatingSystemTypes();
                            continue;
                        }
                        if (property0.NameEquals("hyperVGeneration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            hyperVGeneration = new HyperVGeneration(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("purchasePlan"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            purchasePlan = PurchasePlanAutoGenerated.DeserializePurchasePlanAutoGenerated(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("creationData"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            creationData = CreationData.DeserializeCreationData(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("diskSizeGB"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            diskSizeGB = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("diskSizeBytes"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            diskSizeBytes = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("uniqueId"))
                        {
                            uniqueId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("encryptionSettingsCollection"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            encryptionSettingsCollection = EncryptionSettingsCollection.DeserializeEncryptionSettingsCollection(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("diskIOPSReadWrite"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            diskIOPSReadWrite = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("diskMBpsReadWrite"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            diskMBpsReadWrite = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("diskIOPSReadOnly"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            diskIOPSReadOnly = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("diskMBpsReadOnly"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            diskMBpsReadOnly = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("diskState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            diskState = new DiskState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("encryption"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            encryption = Encryption.DeserializeEncryption(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("maxShares"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            maxShares = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("shareInfo"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <ShareInfoElement> array = new List <ShareInfoElement>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ShareInfoElement.DeserializeShareInfoElement(item));
                            }
                            shareInfo = array;
                            continue;
                        }
                        if (property0.NameEquals("networkAccessPolicy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            networkAccessPolicy = new NetworkAccessPolicy(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("diskAccessId"))
                        {
                            diskAccessId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("tier"))
                        {
                            tier = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("burstingEnabled"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            burstingEnabled = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("propertyUpdatesInProgress"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            propertyUpdatesInProgress = PropertyUpdatesInProgress.DeserializePropertyUpdatesInProgress(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("supportsHibernation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            supportsHibernation = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("securityProfile"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            securityProfile = DiskSecurityProfile.DeserializeDiskSecurityProfile(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new DiskData(id, name, type, tags, location, managedBy.Value, Optional.ToList(managedByExtended), sku.Value, Optional.ToList(zones), extendedLocation.Value, Optional.ToNullable(timeCreated), Optional.ToNullable(osType), Optional.ToNullable(hyperVGeneration), purchasePlan.Value, creationData.Value, Optional.ToNullable(diskSizeGB), Optional.ToNullable(diskSizeBytes), uniqueId.Value, encryptionSettingsCollection.Value, provisioningState.Value, Optional.ToNullable(diskIOPSReadWrite), Optional.ToNullable(diskMBpsReadWrite), Optional.ToNullable(diskIOPSReadOnly), Optional.ToNullable(diskMBpsReadOnly), Optional.ToNullable(diskState), encryption.Value, Optional.ToNullable(maxShares), Optional.ToList(shareInfo), Optional.ToNullable(networkAccessPolicy), diskAccessId.Value, tier.Value, Optional.ToNullable(burstingEnabled), propertyUpdatesInProgress.Value, Optional.ToNullable(supportsHibernation), securityProfile.Value));
        }
Пример #5
0
        internal static SnapshotData DeserializeSnapshotData(JsonElement element)
        {
            Optional <string>            managedBy                               = default;
            Optional <SnapshotSku>       sku                                     = default;
            Optional <ExtendedLocation>  extendedLocation                        = default;
            IDictionary <string, string> tags                                    = default;
            AzureLocation                           location                     = default;
            ResourceIdentifier                      id                           = default;
            string                                  name                         = default;
            ResourceType                            type                         = default;
            Optional <DateTimeOffset>               timeCreated                  = default;
            Optional <OperatingSystemTypes>         osType                       = default;
            Optional <HyperVGeneration>             hyperVGeneration             = default;
            Optional <PurchasePlanAutoGenerated>    purchasePlan                 = default;
            Optional <CreationData>                 creationData                 = default;
            Optional <int>                          diskSizeGB                   = default;
            Optional <long>                         diskSizeBytes                = default;
            Optional <DiskState>                    diskState                    = default;
            Optional <string>                       uniqueId                     = default;
            Optional <EncryptionSettingsCollection> encryptionSettingsCollection = default;
            Optional <string>                       provisioningState            = default;
            Optional <bool>                         incremental                  = default;
            Optional <Encryption>                   encryption                   = default;
            Optional <NetworkAccessPolicy>          networkAccessPolicy          = default;
            Optional <string>                       diskAccessId                 = default;
            Optional <bool>                         supportsHibernation          = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("managedBy"))
                {
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = SnapshotSku.DeserializeSnapshotSku(property.Value);
                    continue;
                }
                if (property.NameEquals("extendedLocation"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("timeCreated"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            timeCreated = property0.Value.GetDateTimeOffset("O");
                            continue;
                        }
                        if (property0.NameEquals("osType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            osType = property0.Value.GetString().ToOperatingSystemTypes();
                            continue;
                        }
                        if (property0.NameEquals("hyperVGeneration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            hyperVGeneration = new HyperVGeneration(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("purchasePlan"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            purchasePlan = PurchasePlanAutoGenerated.DeserializePurchasePlanAutoGenerated(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("creationData"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            creationData = CreationData.DeserializeCreationData(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("diskSizeGB"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            diskSizeGB = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("diskSizeBytes"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            diskSizeBytes = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("diskState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            diskState = new DiskState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("uniqueId"))
                        {
                            uniqueId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("encryptionSettingsCollection"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            encryptionSettingsCollection = EncryptionSettingsCollection.DeserializeEncryptionSettingsCollection(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("incremental"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            incremental = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("encryption"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            encryption = Encryption.DeserializeEncryption(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("networkAccessPolicy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            networkAccessPolicy = new NetworkAccessPolicy(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("diskAccessId"))
                        {
                            diskAccessId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("supportsHibernation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            supportsHibernation = property0.Value.GetBoolean();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new SnapshotData(id, name, type, tags, location, managedBy.Value, sku.Value, extendedLocation.Value, Optional.ToNullable(timeCreated), Optional.ToNullable(osType), Optional.ToNullable(hyperVGeneration), purchasePlan.Value, creationData.Value, Optional.ToNullable(diskSizeGB), Optional.ToNullable(diskSizeBytes), Optional.ToNullable(diskState), uniqueId.Value, encryptionSettingsCollection.Value, provisioningState.Value, Optional.ToNullable(incremental), encryption.Value, Optional.ToNullable(networkAccessPolicy), diskAccessId.Value, Optional.ToNullable(supportsHibernation)));
        }
        internal static DiskRestorePointData DeserializeDiskRestorePointData(JsonElement element)
        {
            ResourceIdentifier                   id                  = default;
            string                               name                = default;
            ResourceType                         type                = default;
            Optional <DateTimeOffset>            timeCreated         = default;
            Optional <string>                    sourceResourceId    = default;
            Optional <OperatingSystemTypes>      osType              = default;
            Optional <HyperVGeneration>          hyperVGeneration    = default;
            Optional <PurchasePlanAutoGenerated> purchasePlan        = default;
            Optional <string>                    familyId            = default;
            Optional <string>                    sourceUniqueId      = default;
            Optional <Encryption>                encryption          = default;
            Optional <bool>                      supportsHibernation = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("timeCreated"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            timeCreated = property0.Value.GetDateTimeOffset("O");
                            continue;
                        }
                        if (property0.NameEquals("sourceResourceId"))
                        {
                            sourceResourceId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("osType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            osType = property0.Value.GetString().ToOperatingSystemTypes();
                            continue;
                        }
                        if (property0.NameEquals("hyperVGeneration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            hyperVGeneration = new HyperVGeneration(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("purchasePlan"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            purchasePlan = PurchasePlanAutoGenerated.DeserializePurchasePlanAutoGenerated(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("familyId"))
                        {
                            familyId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("sourceUniqueId"))
                        {
                            sourceUniqueId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("encryption"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            encryption = Encryption.DeserializeEncryption(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("supportsHibernation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            supportsHibernation = property0.Value.GetBoolean();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new DiskRestorePointData(id, name, type, Optional.ToNullable(timeCreated), sourceResourceId.Value, Optional.ToNullable(osType), Optional.ToNullable(hyperVGeneration), purchasePlan.Value, familyId.Value, sourceUniqueId.Value, encryption.Value, Optional.ToNullable(supportsHibernation)));
        }