def get_by_internal_name_or_title(self, name_title): """Returns the first field (2) in the collection based on the internal name or the title specified by the parameter. :param str name_title: The title or internal name to look up the field (2) by. """ return Field(self.context, ResourcePathServiceOperation("getByInternalNameOrTitle", [name_title], self.resource_path))
def get_item_by_id(self, item_id): """Returns the list item with the specified list item identifier. :type item_id: int """ return ListItem( self.context, ResourcePathServiceOperation("getItemById", [item_id], self.resource_path))
def set_property(self, name, value, persist_changes=True): super(ListTemplate, self).set_property(name, value, persist_changes) if self._resource_path is None: if name == "Name": self._resource_path = ResourcePathServiceOperation( "GetByName", [value], self._parent_collection.resource_path) return self
def set_property(self, name, value, persist_changes=True): super(Field, self).set_property(name, value, persist_changes) # fallback: create a new resource path if name == "Id" and self._resource_path is None: self._resource_path = ResourcePathServiceOperation( "getById", [value], self._parent_collection.resource_path) if name == "FieldTypeKind": self.__class__ = self.resolve_field_type(value)
def set_property(self, name, value, persist_changes=True): super(ListItem, self).set_property(name, value, persist_changes) # fallback: create a new resource path if self._resource_path is None: if name == "Id" and self._parent_collection is not None: self._resource_path = ResourcePathServiceOperation( "getItemById", [value], self._parent_collection.resource_path.parent)
def get_user_by_id(self, user_id): """Returns the user corresponding to the specified member identifier for the current site. :type user_id: long """ return User( self.context, ResourcePathServiceOperation("getUserById", [user_id], self.resource_path))
def get_by_title(self, title): """Returns the first field object in the collection based on the title of the specified field. :type title: str """ return Field( self.context, ResourcePathServiceOperation("getByTitle", [title], self.resource_path))
def get_by_internal_name_or_title(self, name_title): """Returns the first Field object with the specified internal name or title from the collection. :type name_title: str """ return Field( self.context, ResourcePathServiceOperation("getByInternalNameOrTitle", [name_title], self.resource_path))
def get_list(self, url): """Get list by url :type url: str """ return List( self.context, ResourcePathServiceOperation("getList", [url], self.resource_path))
def set_property(self, name, value, persist_changes=True): super(List, self).set_property(name, value, persist_changes) # fallback: create a new resource path if self._resource_path is None: if name == "Id": self._resource_path = ResourcePathServiceOperation( "GetById", [value], self._parent_collection.resource_path) return self
def get_by_id(self, contentTypeId): """ Returns the content type with the given identifier from the collection. If a content type with the given identifier is not found in the collection, the server MUST return null. :param str contentTypeId: A hexadecimal value representing the identifier of a content type. """ return ContentType(self.context, ResourcePathServiceOperation("GetById", [contentTypeId], 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 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 :type url: str """ return Folder( self.context, ResourcePathServiceOperation("GetByUrl", [url], self.resource_path))
def get_related_fields(self): """Returns a collection of lookup fields that use this list as a data source and that have FieldLookup.IsRelationship set to true. """ return RelatedFieldCollection( self.context, ResourcePathServiceOperation("getRelatedFields", [], self.resource_path))
def get_catalog(self, type_catalog): """Specifies the list template gallery, site template gallery, Web Part gallery, master page gallery, or other galleries from the site collection, including custom galleries that are defined by users. :type type_catalog: int""" return List( self.context, ResourcePathServiceOperation("getCatalog", [type_catalog], self.resource_path))
def get_by_login_name(self, login_name): """Retrieve User object by login name :type login_name: str """ return User( self.context, ResourcePathServiceOperation("GetByLoginName", [login_name], self.resource_path))
def get_by_email(self, email): """Retrieve User object by email :type email: str """ return User( self.context, ResourcePathServiceOperation("GetByEmail", [email], self.resource_path))
def get_by_id(self, view_id): """Gets the list view with the specified ID. :type view_id: str """ return View( self.context, ResourcePathServiceOperation("GetById", [view_id], self.resource_path), self._parent)
def get_by_title(self, view_title): """Gets the list view with the specified title. :type view_title: str """ return View( self.context, ResourcePathServiceOperation("GetByTitle", [view_title], self.resource_path), self._parent)
def get_by_id(self, node_id): """Gets the navigation node with the specified ID. :type node_id: str """ return NavigationNode( self.context, ResourcePathServiceOperation("GetById", [node_id], self.resource_path))
def get_catalog(self, type_catalog): """Gets the list template gallery, site template gallery, or Web Part gallery for the Web site. :param int type_catalog: The type of the gallery. """ return List( self.context, ResourcePathServiceOperation("getCatalog", [type_catalog], self.resource_path))
def get_view(self, view_id): """Returns the list view with the specified view identifier. :type view_id: str """ view = View( self.context, ResourcePathServiceOperation("getView", [view_id], self.resourcePath), self) return view
def get_limited_webpart_manager(self, scope): """Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view. """ return LimitedWebPartManager(self.context, ResourcePathServiceOperation( "getlimitedwebpartmanager", [scope], self.resource_path ))
def get_by_type(self, role_type): """Returns role definition of the specified type from the collection. :param int role_type: Specifies the role type. Role type MUST NOT be None. """ return RoleDefinition( self.context, ResourcePathServiceOperation("GetByType", [role_type], self.resource_path))
def get_by_id(self, list_id): """Retrieve List client object by id :type list_id: str """ return List( self.context, ResourcePathServiceOperation("GetById", [list_id], self.resource_path))
def get_by_title(self, list_title): """Retrieve List client object by title :type list_title: str """ return List( self.context, ResourcePathServiceOperation("GetByTitle", [list_title], self.resource_path))
def get_by_name(self, group_name): """Returns a cross-site group from the collection based on the name of the group. :type group_name: str """ return Group( self.context, ResourcePathServiceOperation("getByName", [group_name], self.resource_path))
def get_list_item(self, str_url): """ Returns the list item that is associated with the specified server-relative URL. :param str str_url: A string that contains the server-relative URL, for example, "/sites/MySite/Shared Documents/MyDocument.docx". :return: ListItem """ return_item = ListItem(self.context, ResourcePathServiceOperation("GetListItem", [str_url], self.resource_path)) return return_item
def get_by_id(self, group_id): """Returns the list item with the specified list item identifier. :type group_id: str """ group = Group( self.context, ResourcePathServiceOperation("getbyid", [group_id], self.resource_path)) return group