def METHOD_NAME(obj) -> LicenseInfo | None:
    if not (license_url := obj.get("imageRights", {}).get("link")):
        return None
    # The API returns urls linking to the Finnish version of the license deed,
    # (eg `licenses/by/4.0/deed.fi`), but the license validation logic expects
    # links to the license page (eg `license/by/4.0`).
    return METHOD_NAME(license_url=license_url.removesuffix("deed.fi"))