internal static VaultProperties DeserializeVaultProperties(JsonElement element) { Guid tenantId = default; Sku sku = default; Optional <IList <AccessPolicyEntry> > accessPolicies = default; Optional <string> vaultUri = default; Optional <string> hsmPoolResourceId = default; Optional <bool> enabledForDeployment = default; Optional <bool> enabledForDiskEncryption = default; Optional <bool> enabledForTemplateDeployment = default; Optional <bool> enableSoftDelete = default; Optional <int> softDeleteRetentionInDays = default; Optional <bool> enableRbacAuthorization = default; Optional <CreateMode> createMode = default; Optional <bool> enablePurgeProtection = default; Optional <NetworkRuleSet> networkAcls = default; Optional <VaultProvisioningState> provisioningState = default; Optional <IReadOnlyList <PrivateEndpointConnectionItem> > privateEndpointConnections = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("tenantId")) { tenantId = property.Value.GetGuid(); continue; } if (property.NameEquals("sku")) { sku = Sku.DeserializeSku(property.Value); continue; } if (property.NameEquals("accessPolicies")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <AccessPolicyEntry> array = new List <AccessPolicyEntry>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(AccessPolicyEntry.DeserializeAccessPolicyEntry(item)); } accessPolicies = array; continue; } if (property.NameEquals("vaultUri")) { vaultUri = property.Value.GetString(); continue; } if (property.NameEquals("hsmPoolResourceId")) { hsmPoolResourceId = property.Value.GetString(); continue; } if (property.NameEquals("enabledForDeployment")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } enabledForDeployment = property.Value.GetBoolean(); continue; } if (property.NameEquals("enabledForDiskEncryption")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } enabledForDiskEncryption = property.Value.GetBoolean(); continue; } if (property.NameEquals("enabledForTemplateDeployment")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } enabledForTemplateDeployment = property.Value.GetBoolean(); continue; } if (property.NameEquals("enableSoftDelete")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } enableSoftDelete = property.Value.GetBoolean(); continue; } if (property.NameEquals("softDeleteRetentionInDays")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } softDeleteRetentionInDays = property.Value.GetInt32(); continue; } if (property.NameEquals("enableRbacAuthorization")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } enableRbacAuthorization = property.Value.GetBoolean(); continue; } if (property.NameEquals("createMode")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } createMode = property.Value.GetString().ToCreateMode(); continue; } if (property.NameEquals("enablePurgeProtection")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } enablePurgeProtection = property.Value.GetBoolean(); continue; } if (property.NameEquals("networkAcls")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } networkAcls = NetworkRuleSet.DeserializeNetworkRuleSet(property.Value); continue; } if (property.NameEquals("provisioningState")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new VaultProvisioningState(property.Value.GetString()); continue; } if (property.NameEquals("privateEndpointConnections")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <PrivateEndpointConnectionItem> array = new List <PrivateEndpointConnectionItem>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(PrivateEndpointConnectionItem.DeserializePrivateEndpointConnectionItem(item)); } privateEndpointConnections = array; continue; } } return(new VaultProperties(tenantId, sku, Optional.ToList(accessPolicies), vaultUri.Value, hsmPoolResourceId.Value, Optional.ToNullable(enabledForDeployment), Optional.ToNullable(enabledForDiskEncryption), Optional.ToNullable(enabledForTemplateDeployment), Optional.ToNullable(enableSoftDelete), Optional.ToNullable(softDeleteRetentionInDays), Optional.ToNullable(enableRbacAuthorization), Optional.ToNullable(createMode), Optional.ToNullable(enablePurgeProtection), networkAcls.Value, Optional.ToNullable(provisioningState), Optional.ToList(privateEndpointConnections))); }