pub(super) fn write_fn(as_ct: &impl AsCodeType) -> Result<String, Error>