-- | Transforms a Netsuite record to another type.
transformNS
    :: (IsNsRestletConfig cfg, IsNsType t, IsNsId a, IsNsData d)
    => cfg -- ^ Restlet configuration
    -> t -- ^ NetSuite entity source type (what you're transforming from)
    -> a -- ^ Entity ID
    -> t -- ^ NetSuite entity target type (what you're transforming into)
    -> d -- ^ Data to be used in this transformation
    -> IO (Either RestletError Value)
transformNS cfg st sid tt d =
    doNS (toNsRestletConfig cfg) $
        NsActTransform (toNsType st)
                       (toNsId sid)
                       (toNsType tt)
                       (toNsData d)
                       (typeFields (toNsRestletConfig cfg) $ toNsType tt)
transformNS
    :: (IsNsRestletConfig cfg, IsNsType t, IsNsId a, IsNsData d)
    => cfg -- ^ Restlet configuration
    -> t -- ^ NetSuite entity source type (what you're transforming from)
    -> a -- ^ Entity ID
    -> t -- ^ NetSuite entity target type (what you're transforming into)
    -> d -- ^ Data to be used in this transformation
    -> IO (Either RestletError Value)
transformNS cfg st sid tt d =
    doNS (toNsRestletConfig cfg) $
        NsActTransform (toNsType st)
                       (toNsId sid)
                       (toNsType tt)
                       (toNsData d)
                       (typeFields (toNsRestletConfig cfg) $ toNsType tt)
transformNS cfg st sid tt d =
    doNS (toNsRestletConfig cfg) $
        NsActTransform (toNsType st)
                       (toNsId sid)
                       (toNsType tt)
                       (toNsData d)
                       (typeFields (toNsRestletConfig cfg) $ toNsType tt)