예제 #1
0
        internal static OSDiskImageEncryption DeserializeOSDiskImageEncryption(JsonElement element)
        {
            Optional <OSDiskImageSecurityProfile> securityProfile     = default;
            Optional <ResourceIdentifier>         diskEncryptionSetId = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("securityProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    securityProfile = OSDiskImageSecurityProfile.DeserializeOSDiskImageSecurityProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("diskEncryptionSetId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    diskEncryptionSetId = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
            }
            return(new OSDiskImageEncryption(diskEncryptionSetId.Value, securityProfile.Value));
        }
예제 #2
0
 internal OSDiskImageEncryption(ResourceIdentifier diskEncryptionSetId, OSDiskImageSecurityProfile securityProfile) : base(diskEncryptionSetId)
 {
     SecurityProfile = securityProfile;
 }