Integrations/MicrosoftGraphGroups/MicrosoftGraphGroups.py
def list_members_command(client: Client, args: Dict) -> Tuple[str, Dict, Dict]:
    """List a group members by group id. return outputs in Demisto's format.

    Args:
        client: Client object with request
        args: Usually demisto.args()

    Returns:
        Outputs.
    """
    group_id = str(args.get('group_id'))
    next_link = args.get('next_link')
    top = args.get('top')
    filter_ = args.get('filter')
    members = client.list_members(group_id, next_link, top, filter_)

    if not members['value']:
        human_readable = f'The group {group_id} has no members.'
        return human_readable, NO_OUTPUTS, NO_OUTPUTS

    members_readable, members_outputs = parse_outputs(members['value'])

    # get the group data from the context
    group_data = demisto.dt(demisto.context(), f'{INTEGRATION_CONTEXT_NAME}(val.ID === "{group_id}")')
    if isinstance(group_data, list):
        group_data = group_data[0]

    if '@odata.nextLink' in members:
        next_link_response = members['@odata.nextLink']
        group_data['Members'] = members_outputs  # add a field with the members to the group
        group_data['Members']['NextLink'] = next_link_response
        entry_context = {f'{INTEGRATION_CONTEXT_NAME}(val.ID === obj.ID)': group_data}
        title = f'Group {group_id} members ' \
                f'(Note that there are more results. Please use the next_link argument to see them.):'
    else:
        group_data['Members'] = members_outputs  # add a field with the members to the group
        entry_context = {f'{INTEGRATION_CONTEXT_NAME}(val.ID === obj.ID)': group_data}
        title = f'Group {group_id} members:'

    human_readable = tableToMarkdown(name=title, t=members_readable,
                                     headers=['ID', 'Display Name', 'Job Title', 'Mail'],
                                     removeNull=True)

    return human_readable, entry_context, members
List a group members by group id. return outputs in Demisto's format.

    Args:
        client: Client object with request
        args: Usually demisto.args()

    Returns:
        Outputs.
    
List a group members by group id. return outputs in Demisto's format.
List a group members by group id . return outputs in Demisto ' s format .
def list_members_command(client: Client, args: Dict) -> Tuple[str, Dict, Dict]:
    group_id = str(args.get('group_id'))
    next_link = args.get('next_link')
    top = args.get('top')
    filter_ = args.get('filter')
    members = client.list_members(group_id, next_link, top, filter_)
    if not members['value']:
        human_readable = f'The group {group_id} has no members.'
        return human_readable, NO_OUTPUTS, NO_OUTPUTS
    members_readable, members_outputs = parse_outputs(members['value'])
    group_data = demisto.dt(demisto.context(), f'{INTEGRATION_CONTEXT_NAME}(val.ID === "{group_id}")')
    if isinstance(group_data, list):
        group_data = group_data[0]
    if '@odata.nextLink' in members:
        next_link_response = members['@odata.nextLink']
        group_data['Members'] = members_outputs  
        group_data['Members']['NextLink'] = next_link_response
        entry_context = {f'{INTEGRATION_CONTEXT_NAME}(val.ID === obj.ID)': group_data}
        title = f'Group {group_id} members ' \
                f'(Note that there are more results. Please use the next_link argument to see them.):'
    else:
        group_data['Members'] = members_outputs  
        entry_context = {f'{INTEGRATION_CONTEXT_NAME}(val.ID === obj.ID)': group_data}
        title = f'Group {group_id} members:'
    human_readable = tableToMarkdown(name=title, t=members_readable,
                                     headers=['ID', 'Display Name', 'Job Title', 'Mail'],
                                     removeNull=True)
    return human_readable, entry_context, members
def list_members_command ( client : Client , args : Dict ) -> Tuple [ str , Dict , Dict ] : group_id = str ( args . get ( 'group_id' ) ) next_link = args . get ( 'next_link' ) top = args . get ( 'top' ) filter_ = args . get ( 'filter' ) members = client . list_members ( group_id , next_link , top , filter_ ) if not members [ 'value' ] : human_readable = f'The group {group_id} has no members.' return human_readable , NO_OUTPUTS , NO_OUTPUTS members_readable , members_outputs = parse_outputs ( members [ 'value' ] ) group_data = demisto . dt ( demisto . context ( ) , f'{INTEGRATION_CONTEXT_NAME}(val.ID === "{group_id}")' ) if isinstance ( group_data , list ) : group_data = group_data [ 0 ] if '@odata.nextLink' in members : next_link_response = members [ '@odata.nextLink' ] group_data [ 'Members' ] = members_outputs group_data [ 'Members' ] [ 'NextLink' ] = next_link_response entry_context = { f'{INTEGRATION_CONTEXT_NAME}(val.ID === obj.ID)' : group_data } title = f'Group {group_id} members ' f'(Note that there are more results. Please use the next_link argument to see them.):' else : group_data [ 'Members' ] = members_outputs entry_context = { f'{INTEGRATION_CONTEXT_NAME}(val.ID === obj.ID)' : group_data } title = f'Group {group_id} members:' human_readable = tableToMarkdown ( name = title , t = members_readable , headers = [ 'ID' , 'Display Name' , 'Job Title' , 'Mail' ] , removeNull = True ) return human_readable , entry_context , members
List a group members by group id.
List a group members by group id .
"""List a group members by group id. return outputs in Demisto's format.

    Args:
        client: Client object with request
        args: Usually demisto.args()

    Returns:
        Outputs.
    """ # get the group data from the context # add a field with the members to the group # add a field with the members to the group
None
client
Client
Client object with request
Client object with request
args
Dict
None