def get_members_for_group(service, group):
    """
    Get all members for a specified group via Google API.

    :param service: Authenticated directory service object
    :param group: The id for the group
    :return: List of all members
    """
    results = service.members().list(
        groupKey=group,
        maxResults=500
    ).execute()

    direct_members = results.get('members', [])

    while 'nextPageToken' in results:
        results = service.members().list(
            groupKey=group,
            maxResults=500,
            pageToken=results['nextPageToken']
        ).execute()

        direct_members += results.get('members', [])

    members = []

    for member in direct_members:
        if member['type'] == 'GROUP':
            members.extend(get_members_for_group(service, member['email']))
        else:
            members.append(member)

    return members