-- | Attaches an object to another in Netsuite.
attachNS
    :: (IsNsRestletConfig cfg, IsNsType t, IsNsId a, IsNsData d)
    => cfg -- ^ Restlet configuration
    -> t -- ^ Type of entities to attach to
    -> [a] -- ^ Target entity IDs to attach to
    -> t -- ^ Type of entity to attach
    -> a -- ^ Entity ID to attach
    -> d -- ^ Data to assign to attachment
    -> IO (Either RestletError Value)
attachNS cfg targetType targetIDs attType attID attrs =
    doNS (toNsRestletConfig cfg) $
        NsActAttach (toNsType targetType)
                    (map toNsId targetIDs)
                    (toNsType attType)
                    (toNsId attID)
                    (toNsData attrs)
attachNS
    :: (IsNsRestletConfig cfg, IsNsType t, IsNsId a, IsNsData d)
    => cfg -- ^ Restlet configuration
    -> t -- ^ Type of entities to attach to
    -> [a] -- ^ Target entity IDs to attach to
    -> t -- ^ Type of entity to attach
    -> a -- ^ Entity ID to attach
    -> d -- ^ Data to assign to attachment
    -> IO (Either RestletError Value)
attachNS cfg targetType targetIDs attType attID attrs =
    doNS (toNsRestletConfig cfg) $
        NsActAttach (toNsType targetType)
                    (map toNsId targetIDs)
                    (toNsType attType)
                    (toNsId attID)
                    (toNsData attrs)
attachNS cfg targetType targetIDs attType attID attrs =
    doNS (toNsRestletConfig cfg) $
        NsActAttach (toNsType targetType)
                    (map toNsId targetIDs)
                    (toNsType attType)
                    (toNsId attID)
                    (toNsData attrs)