Integrations/MicrosoftGraphFiles/MicrosoftGraphFiles.py
def replace_an_existing_file_command(client, args):
    """
    This function runs the replace existing file command
    :return: human_readable, context, result
    """
    object_type = args.get("object_type")
    item_id = args.get("item_id")
    entry_id = args.get("entry_id")
    object_type_id = args.get("object_type_id")

    result = client.replace_existing_file(
        object_type, object_type_id, item_id, entry_id
    )
    context_entry = parse_key_to_context(result)

    human_readable_content = {
        "ID": context_entry.get("ID"),
        "Name": context_entry.get("Name"),
        "CreatedBy": context_entry.get("CreatedBy").get("DisplayName"),
        "CreatedDateTime": context_entry.get("CreatedDateTime"),
        "LastModifiedBy": context_entry.get("LastModifiedBy").get("DisplayName"),
        "Size": context_entry.get("Size"),
        "WebUrl": context_entry.get("WebUrl"),
    }

    title = f"{INTEGRATION_NAME} - File information:"
    # Creating human readable for War room
    human_readable = tableToMarkdown(
        title, human_readable_content, headerTransform=pascalToSpace
    )

    # context == output
    context = {f"{INTEGRATION_NAME}.ReplacedFiles(val.ID === obj.ID)": context_entry}

    return human_readable, context, result

    This function runs the replace existing file command
    :return: human_readable, context, result
    
This function runs the replace existing file command
This function runs the replace existing file command
def replace_an_existing_file_command(client, args):
    object_type = args.get("object_type")
    item_id = args.get("item_id")
    entry_id = args.get("entry_id")
    object_type_id = args.get("object_type_id")
    result = client.replace_existing_file(
        object_type, object_type_id, item_id, entry_id
    )
    context_entry = parse_key_to_context(result)
    human_readable_content = {
        "ID": context_entry.get("ID"),
        "Name": context_entry.get("Name"),
        "CreatedBy": context_entry.get("CreatedBy").get("DisplayName"),
        "CreatedDateTime": context_entry.get("CreatedDateTime"),
        "LastModifiedBy": context_entry.get("LastModifiedBy").get("DisplayName"),
        "Size": context_entry.get("Size"),
        "WebUrl": context_entry.get("WebUrl"),
    }
    title = f"{INTEGRATION_NAME} - File information:"
    human_readable = tableToMarkdown(
        title, human_readable_content, headerTransform=pascalToSpace
    )
    context = {f"{INTEGRATION_NAME}.ReplacedFiles(val.ID === obj.ID)": context_entry}
    return human_readable, context, result
def replace_an_existing_file_command ( client , args ) : object_type = args . get ( "object_type" ) item_id = args . get ( "item_id" ) entry_id = args . get ( "entry_id" ) object_type_id = args . get ( "object_type_id" ) result = client . replace_existing_file ( object_type , object_type_id , item_id , entry_id ) context_entry = parse_key_to_context ( result ) human_readable_content = { "ID" : context_entry . get ( "ID" ) , "Name" : context_entry . get ( "Name" ) , "CreatedBy" : context_entry . get ( "CreatedBy" ) . get ( "DisplayName" ) , "CreatedDateTime" : context_entry . get ( "CreatedDateTime" ) , "LastModifiedBy" : context_entry . get ( "LastModifiedBy" ) . get ( "DisplayName" ) , "Size" : context_entry . get ( "Size" ) , "WebUrl" : context_entry . get ( "WebUrl" ) , } title = f"{INTEGRATION_NAME} - File information:" human_readable = tableToMarkdown ( title , human_readable_content , headerTransform = pascalToSpace ) context = { f"{INTEGRATION_NAME}.ReplacedFiles(val.ID === obj.ID)" : context_entry } return human_readable , context , result
This function runs the replace existing file command
This function runs the replace existing file command
"""
    This function runs the replace existing file command
    :return: human_readable, context, result
    """ # Creating human readable for War room # context == output
human_readable, context, result
human_readable context result
client
args