def FindPart(part: dict, mime_type: str):
    """
    Recursively parses the parts of an email and returns the first part with the requested mime_type.

    :param part: Part of the email to parse (generally called on the payload).
    :param mime_type: MIME Type to look for.
    :return: The part of the email with the matching type.
    """
    if part['mimeType'] == mime_type:
        return part
    elif 'multipart' in part['mimeType']:
        for child in part['parts']:
            out = FindPart(child, mime_type)
            if out is not None:
                return out