Integrations/MicrosoftGraphFiles/MicrosoftGraphFiles.py
def create_new_folder(self, object_type, object_type_id, parent_id, folder_name):
        """
        Create a new folder in a Drive with a specified parent item or path.
        :param object_type: ms graph resource.
        :param object_type_id: the selected object type id.
        :param parent_id: an ID of the Drive to upload the folder to.
        :param folder_name: folder name
        :return: graph api raw response
        """
        if object_type == "drives":
            url = f"{object_type}/{object_type_id}/items/{parent_id}/children"

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

        # send request
        url = self.base_url + f"/{url}"

        payload = {
            "name": folder_name,
            "folder": {},
            "@microsoft.graph.conflictBehavior": "rename",
        }
        self.headers["Content-Type"] = "application/json"
        demisto.log(f"sending POST to {url}, with the next payload: {payload}")
        return self.http_call(
            "POST", full_url=url, json_data=payload, headers=self.headers, url_suffix=""
        )

        Create a new folder in a Drive with a specified parent item or path.
        :param object_type: ms graph resource.
        :param object_type_id: the selected object type id.
        :param parent_id: an ID of the Drive to upload the folder to.
        :param folder_name: folder name
        :return: graph api raw response
        
Create a new folder in a Drive with a specified parent item or path.
Create a new folder in a Drive with a specified parent item or path .
def create_new_folder(self, object_type, object_type_id, parent_id, folder_name):
        if object_type == "drives":
            url = f"{object_type}/{object_type_id}/items/{parent_id}/children"
        elif object_type in ["groups", "sites", "users"]:
            url = f"{object_type}/{object_type_id}/drive/items/{parent_id}/children"
        url = self.base_url + f"/{url}"
        payload = {
            "name": folder_name,
            "folder": {},
            "@microsoft.graph.conflictBehavior": "rename",
        }
        self.headers["Content-Type"] = "application/json"
        demisto.log(f"sending POST to {url}, with the next payload: {payload}")
        return self.http_call(
            "POST", full_url=url, json_data=payload, headers=self.headers, url_suffix=""
        )
def create_new_folder ( self , object_type , object_type_id , parent_id , folder_name ) : if object_type == "drives" : url = f"{object_type}/{object_type_id}/items/{parent_id}/children" elif object_type in [ "groups" , "sites" , "users" ] : url = f"{object_type}/{object_type_id}/drive/items/{parent_id}/children" url = self . base_url + f"/{url}" payload = { "name" : folder_name , "folder" : { } , "@microsoft.graph.conflictBehavior" : "rename" , } self . headers [ "Content-Type" ] = "application/json" demisto . log ( f"sending POST to {url}, with the next payload: {payload}" ) return self . http_call ( "POST" , full_url = url , json_data = payload , headers = self . headers , url_suffix = "" )
Create a new folder in a Drive with a specified parent item or path.
Create a new folder in a Drive with a specified parent item or path .
"""
        Create a new folder in a Drive with a specified parent item or path.
        :param object_type: ms graph resource.
        :param object_type_id: the selected object type id.
        :param parent_id: an ID of the Drive to upload the folder to.
        :param folder_name: folder name
        :return: graph api raw response
        """ # send request
graph api raw response
graph api raw response
self
object_type
ms graph resource.
ms graph resource .
object_type_id
the selected object type id.
the selected object type id .
parent_id
an ID of the Drive to upload the folder to.
an ID of the Drive to upload the folder to .
folder_name
None