internal PrivateLinkServiceProxy(string id, DeviceUpdatePrivateLinkServiceConnectionState remotePrivateLinkServiceConnectionState, SubResource remotePrivateEndpointConnection, IList <GroupConnectivityInformation> groupConnectivityInformation)
 {
     Id = id;
     RemotePrivateLinkServiceConnectionState = remotePrivateLinkServiceConnectionState;
     RemotePrivateEndpointConnection         = remotePrivateEndpointConnection;
     GroupConnectivityInformation            = groupConnectivityInformation;
 }
        internal static PrivateLinkServiceProxy DeserializePrivateLinkServiceProxy(JsonElement element)
        {
            Optional <string> id = default;
            Optional <DeviceUpdatePrivateLinkServiceConnectionState> remotePrivateLinkServiceConnectionState = default;
            Optional <SubResource> remotePrivateEndpointConnection = default;
            Optional <IList <GroupConnectivityInformation> > groupConnectivityInformation = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("remotePrivateLinkServiceConnectionState"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    remotePrivateLinkServiceConnectionState = DeviceUpdatePrivateLinkServiceConnectionState.DeserializeDeviceUpdatePrivateLinkServiceConnectionState(property.Value);
                    continue;
                }
                if (property.NameEquals("remotePrivateEndpointConnection"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    remotePrivateEndpointConnection = JsonSerializer.Deserialize <SubResource>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("groupConnectivityInformation"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <GroupConnectivityInformation> array = new List <GroupConnectivityInformation>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(Models.GroupConnectivityInformation.DeserializeGroupConnectivityInformation(item));
                    }
                    groupConnectivityInformation = array;
                    continue;
                }
            }
            return(new PrivateLinkServiceProxy(id.Value, remotePrivateLinkServiceConnectionState.Value, remotePrivateEndpointConnection, Optional.ToList(groupConnectivityInformation)));
        }