<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def create( cls, interface: Interface, mode: LinkMode, subnet: Union[Subnet, int] = None, ip_address: str = None, force: bool = False, default_gateway: bool = False):
 """ Create a link on `Interface` in MAAS. :param interface: Interface to create the link on. :type interface: `Interface` :param mode: Mode of the link. :type mode: `LinkMode` :param subnet: The subnet to create the link on (optional). :type subnet: `Subnet` or `int` :param ip_address: The IP address to assign to the link. :type ip_address: `str` :param force: If True, allows `LinkMode.LINK_UP` to be created even if other links already exist. Also allows the selection of any subnet no matter the VLAN the subnet belongs to. Using this option will cause all other interface links to be deleted (optional). :type force: `bool` :param default_gateway: If True, sets the gateway IP address for the subnet as the default gateway for the node this interface belongs to. Option can only be used with the `LinkMode.AUTO` and `LinkMode.STATIC` modes. :type default_gateway: `bool` :returns: The created InterfaceLink. :rtype: `InterfaceLink` """

        if not isinstance(interface, Interface):
            raise TypeError(
                "interface must be an Interface, not %s"
                % type(interface).__name__)
        if not isinstance(mode, LinkMode):
            raise TypeError(
                "mode must be a LinkMode, not %s"
                % type(mode).__name__)
        if subnet is not None:
            if isinstance(subnet, Subnet):
                subnet = subnet.id
            elif isinstance(subnet, int):
                pass
            else:
                raise TypeError(
                    "subnet must be a Subnet or int, not %s"
                    % type(subnet).__name__)
        if mode in [LinkMode.AUTO, LinkMode.STATIC]:
            if subnet is None:
                raise ValueError('subnet is required for %s' % mode)
        if default_gateway and mode not in [LinkMode.AUTO, LinkMode.STATIC]:
            raise ValueError('cannot set as default_gateway for %s' % mode)
        params = {
            'system_id': interface.node.system_id,
            'id': interface.id,
            'mode': mode.value,
            'force': force,
            'default_gateway': default_gateway,
        }
        if subnet is not None:
            params['subnet'] = subnet
        if ip_address is not None:
            params['ip_address'] = ip_address
        # The API doesn't return just the link it returns the whole interface.
        # Store the link ids before the save to find the addition at the end.
        link_ids = {
            link.id
            for link in interface.links
        }
        data = await interface._handler.link_subnet(**params)
        # Update the links on the interface, except for the newly created link
        # the `ManagedCreate` wrapper will add that to the interfaces link data
        # automatically.
        new_links = {
            link['id']: link
            for link in data['links']
        }
        links_diff = list(set(new_links.keys()) - link_ids)
        new_link = new_links.pop(links_diff[0])
        interface._data['links'] = list(new_links.values())
        interface._orig_data['links'] = copy.deepcopy(interface._data['links'])
        return cls._object(new_link)