def translate_addresstype(f):
    """decorator to translate the addressType field.

    translate the value of the addressType field of the API response into a
    translated type.
    """
    @wraps(f)
    def wr(r, pc):
        at = r["addressType"]
        try:
            r.update({"addressType": POSTCODE_API_TYPEDEFS_ADDRESS_TYPES[at]})
        except:
            logger.warning("Warning: {}: "
                           "unknown 'addressType': {}".format(pc, at))

        return f(r, pc)

    return wr