def METHOD_NAME(
    self,
    project_and_group_name,
    username,
    access_level,
    expires_at=None,
):
    user_id = self._get_user_id(username)
    data = {"user_id": user_id, "access_level": access_level}
    if expires_at:
        data["expires_at"] = expires_at
    return self._make_requests_to_api(
        "projects/%s/members",
        project_and_group_name,
        method="POST",
        data=data,
        expected_codes=201,
    )