def METHOD_NAME(
    self,
    id_name: str | None = None,
    id_id: str | None = None,
    field: Literal["id", "username"] = "id",
    provision: bool = False,
) -> str | None:
    assert (id_name or id_id) and not (id_name and id_id)
    kw: GetIdentitiesKwargs = dict(provision=provision)
    if id_name:
        kw["usernames"] = id_name
    elif id_id:
        kw["ids"] = id_id
    else:
        raise NotImplementedError("must provide id or name")
    try:
        value = self.get_identities(**kw)["identities"][0][field]
    # capture any failure to lookup this data, including:
    # - identity doesn't exist (`identities=[]`)
    # - field is missing
    except LookupError:
        return None
    if not isinstance(value, str):
        return None
    return value