Integrations/MicrosoftGraphFiles/MicrosoftGraphFiles.py
def delete_file(self, object_type, object_type_id, item_id):
        """
        Delete a DriveItem by using its ID
        :param object_type: ms graph resource.
        :param object_type_id: ms graph resource id.
        :param item_id: ms graph item_id.
        :return: graph api raw response
        """
        if object_type == "drives":
            url = f"{object_type}/{object_type_id}/items/{item_id}"

        elif object_type in ["groups", "sites", "users"]:
            url = f"{object_type}/{object_type_id}/drive/items/{item_id}"

        # send request
        url = self.base_url + f"/{url}"
        self.headers[
            "Content-Type"
        ] = "text/plain"  # request returned empty and can not decoded to json
        if "" == self.http_call(
            "DELETE",
            full_url=url,
            headers=self.headers,
            url_suffix="",
            resp_type="text",
        ):
            # resp_type='text' returned empty and can not decoded to json
            return f"Item was deleted successfully"

        Delete a DriveItem by using its ID
        :param object_type: ms graph resource.
        :param object_type_id: ms graph resource id.
        :param item_id: ms graph item_id.
        :return: graph api raw response
        
Delete a DriveItem by using its ID
Delete a DriveItem by using its ID
def delete_file(self, object_type, object_type_id, item_id):
        if object_type == "drives":
            url = f"{object_type}/{object_type_id}/items/{item_id}"
        elif object_type in ["groups", "sites", "users"]:
            url = f"{object_type}/{object_type_id}/drive/items/{item_id}"
        url = self.base_url + f"/{url}"
        self.headers[
            "Content-Type"
        ] = "text/plain"  
        if "" == self.http_call(
            "DELETE",
            full_url=url,
            headers=self.headers,
            url_suffix="",
            resp_type="text",
        ):
            return f"Item was deleted successfully"
def delete_file ( self , object_type , object_type_id , item_id ) : if object_type == "drives" : url = f"{object_type}/{object_type_id}/items/{item_id}" elif object_type in [ "groups" , "sites" , "users" ] : url = f"{object_type}/{object_type_id}/drive/items/{item_id}" url = self . base_url + f"/{url}" self . headers [ "Content-Type" ] = "text/plain" if "" == self . http_call ( "DELETE" , full_url = url , headers = self . headers , url_suffix = "" , resp_type = "text" , ) : return f"Item was deleted successfully"
Delete a DriveItem by using its ID
Delete a DriveItem by using its ID
"""
        Delete a DriveItem by using its ID
        :param object_type: ms graph resource.
        :param object_type_id: ms graph resource id.
        :param item_id: ms graph item_id.
        :return: graph api raw response
        """ # send request # request returned empty and can not decoded to json # resp_type='text' returned empty and can not decoded to json
graph api raw response
graph api raw response
self
object_type
ms graph resource.
ms graph resource .
object_type_id
ms graph resource id.
ms graph resource id .
item_id
ms graph item_id.
ms graph item_id .