def add(self, folder_url): folder = Folder(self.context) self.add_child(folder) folder.set_property("ServerRelativeUrl", folder_url) qry = CreateEntityQuery(self, folder, folder) self.context.add_query(qry) return folder
def add(self, folder_url): from office365.sharepoint.folder import Folder folder = Folder(self.context) folder.set_property("ServerRelativeUrl", folder_url) qry = ClientQuery(self.url, ActionType.CreateEntry, folder.convert_to_payload()) self.context.add_query(qry, folder) return folder
def add(self, server_relative_url): """Adds the folder that is located at the specified URL to the collection. :type server_relative_url: str """ folder = Folder(self.context) self.add_child(folder) folder.set_property("ServerRelativeUrl", server_relative_url) qry = CreateEntityQuery(self, folder, folder) self.context.add_query(qry) return folder
def get_by_url(self, url): """Retrieve Folder resource by url""" from office365.sharepoint.folder import Folder return Folder( self.context, ResourcePathServiceOperation(self.context, self.resource_path, "GetByUrl", [url]))
def folder(self): """Get folder""" if self.is_property_available("Folder"): return self.properties["Folder"] else: from office365.sharepoint.folder import Folder return Folder(self.context, ResourcePath("Folder", self.resource_path))
def get_folder_by_server_relative_url(self, url): """Returns the folder object located at the specified server-relative URL.""" folder_obj = Folder( self.context, ResourcePathServiceOperation(self.context, self.resource_path, "getfolderbyserverrelativeurl", [url]) ) return folder_obj
def rootFolder(self): """Get a root folder""" if self.is_property_available('RootFolder'): return self.properties["RootFolder"] else: return Folder(self.context, ResourcePath("RootFolder", self.resourcePath))
def get_by_url(self, url): """Retrieve Folder resource by url :type url: str """ return Folder( self.context, ResourcePathServiceOperation("GetByUrl", [url], self.resource_path))
def get_folder_by_server_relative_url(self, url): """Returns the folder object located at the specified server-relative URL. :type url: str """ return Folder( self.context, ResourcePathServiceOperation("getFolderByServerRelativeUrl", [url], self.resource_path))
def get_by_url(self, url): """Retrieve Folder resource by url""" return Folder( self.context, ResourcePathServiceOperation(self.context, self.resourcePath, "GetByUrl", [url]))
def add(self, folder_url): folder = Folder(self.context) folder.set_property("ServerRelativeUrl", folder_url) qry = ClientQuery(self.resourceUrl, HttpMethod.Post, folder) self.context.add_query(qry, folder) return folder
def add(self, folder_url): folder = Folder(self.context) folder.set_property("ServerRelativeUrl", folder_url) qry = ClientQuery(self.resource_url, ActionType.CreateEntity, folder) self.context.add_query(qry, folder) return folder