internal static ComputePrivateEndpointConnectionData DeserializeComputePrivateEndpointConnectionData(JsonElement element) { ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <Resources.Models.SubResource> privateEndpoint = default; Optional <ComputePrivateLinkServiceConnectionState> privateLinkServiceConnectionState = default; Optional <ComputePrivateEndpointConnectionProvisioningState> provisioningState = 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("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("privateEndpoint")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } privateEndpoint = JsonSerializer.Deserialize <Resources.Models.SubResource>(property0.Value.ToString()); continue; } if (property0.NameEquals("privateLinkServiceConnectionState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } privateLinkServiceConnectionState = ComputePrivateLinkServiceConnectionState.DeserializeComputePrivateLinkServiceConnectionState(property0.Value); continue; } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new ComputePrivateEndpointConnectionProvisioningState(property0.Value.GetString()); continue; } } continue; } } return(new ComputePrivateEndpointConnectionData(id, name, type, systemData, privateEndpoint, privateLinkServiceConnectionState.Value, Optional.ToNullable(provisioningState))); }
internal ComputePrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Resources.Models.SubResource privateEndpoint, ComputePrivateLinkServiceConnectionState privateLinkServiceConnectionState, ComputePrivateEndpointConnectionProvisioningState?provisioningState) : base(id, name, resourceType, systemData) { PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; ProvisioningState = provisioningState; }