internal static PrivateEndpointConnectionProperties DeserializePrivateEndpointConnectionProperties(JsonElement element)
        {
            Optional <PrivateEndpointProperty> privateEndpoint = default;
            Optional <PrivateLinkServiceConnectionStatePropertyAutoGenerated> privateLinkServiceConnectionState = default;
            Optional <PrivateEndpointProvisioningState> provisioningState = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("privateEndpoint"))
                {
                    privateEndpoint = PrivateEndpointProperty.DeserializePrivateEndpointProperty(property.Value);
                    continue;
                }
                if (property.NameEquals("privateLinkServiceConnectionState"))
                {
                    privateLinkServiceConnectionState = PrivateLinkServiceConnectionStatePropertyAutoGenerated.DeserializePrivateLinkServiceConnectionStatePropertyAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("provisioningState"))
                {
                    provisioningState = new PrivateEndpointProvisioningState(property.Value.GetString());
                    continue;
                }
            }
            return(new PrivateEndpointConnectionProperties(privateEndpoint.Value, privateLinkServiceConnectionState.Value, Optional.ToNullable(provisioningState)));
        }
        internal static PrivateEndpointConnectionProperties DeserializePrivateEndpointConnectionProperties(JsonElement element)
        {
            Optional <WritableSubResource> privateEndpoint = default;
            Optional <SqlPrivateLinkServiceConnectionStateProperty> privateLinkServiceConnectionState = default;
            Optional <PrivateEndpointProvisioningState>             provisioningState = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("privateEndpoint"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    privateEndpoint = JsonSerializer.Deserialize <WritableSubResource>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("privateLinkServiceConnectionState"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    privateLinkServiceConnectionState = SqlPrivateLinkServiceConnectionStateProperty.DeserializeSqlPrivateLinkServiceConnectionStateProperty(property.Value);
                    continue;
                }
                if (property.NameEquals("provisioningState"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    provisioningState = new PrivateEndpointProvisioningState(property.Value.GetString());
                    continue;
                }
            }
            return(new PrivateEndpointConnectionProperties(privateEndpoint, privateLinkServiceConnectionState.Value, Optional.ToNullable(provisioningState)));
        }