internal EncryptionScopeData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, EncryptionScopeSource?source, EncryptionScopeState?state, DateTimeOffset?creationTime, DateTimeOffset?lastModifiedTime, EncryptionScopeKeyVaultProperties keyVaultProperties, bool?requireInfrastructureEncryption) : base(id, name, type, systemData) { Source = source; State = state; CreationTime = creationTime; LastModifiedTime = lastModifiedTime; KeyVaultProperties = keyVaultProperties; RequireInfrastructureEncryption = requireInfrastructureEncryption; }
internal static EncryptionScopeData DeserializeEncryptionScopeData(JsonElement element) { ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional <EncryptionScopeSource> source = default; Optional <EncryptionScopeState> state = default; Optional <DateTimeOffset> creationTime = default; Optional <DateTimeOffset> lastModifiedTime = default; Optional <EncryptionScopeKeyVaultProperties> keyVaultProperties = default; Optional <bool> requireInfrastructureEncryption = 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("source")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } source = new EncryptionScopeSource(property0.Value.GetString()); continue; } if (property0.NameEquals("state")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } state = new EncryptionScopeState(property0.Value.GetString()); continue; } if (property0.NameEquals("creationTime")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } creationTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("lastModifiedTime")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } lastModifiedTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("keyVaultProperties")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } keyVaultProperties = EncryptionScopeKeyVaultProperties.DeserializeEncryptionScopeKeyVaultProperties(property0.Value); continue; } if (property0.NameEquals("requireInfrastructureEncryption")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } requireInfrastructureEncryption = property0.Value.GetBoolean(); continue; } } continue; } } return(new EncryptionScopeData(id, name, type, Optional.ToNullable(source), Optional.ToNullable(state), Optional.ToNullable(creationTime), Optional.ToNullable(lastModifiedTime), keyVaultProperties.Value, Optional.ToNullable(requireInfrastructureEncryption))); }