def METHOD_NAME(self, data, **kwargs):
    """Validate attachments per format."""
    def get_attach_by_id(attach_id):
        """Return attachment with input identifier."""
        for atch in attachments:
            if atch.ident == attach_id:
                return atch
        raise ValidationError(f"No attachment for attach_id {attach_id} in formats")
    formats = data.get("formats") or []
    attachments = data.get("credentials_attach") or []
    if len(formats) != len(attachments):
        raise ValidationError("Formats/attachments length mismatch")
    for fmt in formats:
        atch = get_attach_by_id(fmt.attach_id)
        cred_format = V20CredFormat.Format.get(fmt.format)
        if cred_format:
            cred_format.METHOD_NAME(CRED_20_ISSUE, atch.content)