コード例 #1
0
ファイル: web.py プロジェクト: biancini/TeamsLogExporter
 def push_notification_subscribers(self):
     return self.properties.get(
         'PushNotificationSubscribers',
         BaseEntityCollection(
             self.context, PushNotificationSubscriber,
             ResourcePath("PushNotificationSubscribers",
                          self.resource_path)))
コード例 #2
0
 def shared_with_users_collection(self):
     """A collection of shared with users."""
     return self.properties.get(
         'SharedWithUsersCollection',
         BaseEntityCollection(
             self.context, ObjectSharingInformationUser,
             ResourcePath("SharedWithUsersCollection", self.resource_path)))
コード例 #3
0
 def version_events(self):
     """Gets the history of events on this version object."""
     return self.properties.get(
         "VersionEvents",
         BaseEntityCollection(
             self.context, FileVersionEvent,
             ResourcePath("VersionEvents", self.resource_path)))
コード例 #4
0
 def available_apps(self):
     """Returns the apps available in this corporate catalog."""
     return self.properties.get(
         'AvailableApps',
         BaseEntityCollection(
             self.context, CorporateCatalogAppMetadata,
             ResourcePath("AvailableApps", self.resource_path)))
コード例 #5
0
ファイル: group.py プロジェクト: biancini/TeamsLogExporter
    def get_members(self):
        from office365.directory.users.user import User
        members = BaseEntityCollection(self.context, User)

        def _group_loaded():
            SPHelper.get_members(self.context, self.properties["Id"], members)
        self.ensure_property("Id", _group_loaded)
        return members
コード例 #6
0
 def liked_by(self):
     """
     List of like entries corresponding to individual likes. MUST NOT contain more than one entry
     for the same user in the set.
     """
     return self.properties.get(
         'likedBy',
         BaseEntityCollection(self.context, UserEntity,
                              ResourcePath("likedBy", self.resource_path)))
コード例 #7
0
 def get_my_followers(self):
     """
     This method returns a list of PersonProperties objects for the people who are following the current user.
     """
     return_type = BaseEntityCollection(self.context, PersonProperties)
     qry = ServiceOperationQuery(self, "GetMyFollowers", None, None, None,
                                 return_type)
     self.context.add_query(qry)
     return return_type
コード例 #8
0
ファイル: SPHelper.py プロジェクト: biancini/TeamsLogExporter
 def get_owners(context, group_id, return_type=None):
     """
     :param str group_id: Group identifier
     :param office365.sharepoint.client_context.ClientContext context: SharePoint context
     :param BaseEntityCollection or None return_type: Returns members
     """
     helper = SPHelper(context)
     if return_type is None:
         return_type = BaseEntityCollection(context, User)
     qry = ServiceOperationQuery(helper, "GetOwners", [group_id], None, None, return_type)
     qry.static = True
     context.add_query(qry)
     return return_type
コード例 #9
0
    def get_followers_for(self, account_name):
        """
        Gets the people who are following the specified user.

        :param str account_name: Account name of the specified user.
        :return:
        """
        return_type = BaseEntityCollection(self.context, PersonProperties)
        params = {"accountName": account_name}
        qry = ServiceOperationQuery(self, "GetFollowersFor", params, None,
                                    None, return_type)
        self.context.add_query(qry)
        return return_type
コード例 #10
0
    def get_site_design_rights(context, _id):
        """
        Gets a list of principals that have access to a site design.

        :type _id: str
        :param office365.sharepoint.client_context.ClientContext context: SharePoint client

        """
        return_type = BaseEntityCollection(context, SiteDesignPrincipal)
        utility = SiteScriptUtility(context)
        qry = ServiceOperationQuery(utility, "GetSiteDesignRights", [_id], None, None, return_type)
        qry.static = True
        context.add_query(qry)
        return return_type
コード例 #11
0
    def get_people_followed_by(self, account_name):
        """
        The GetPeopleFollowedBy method returns a  list of PersonProperties objects for people who the specified user
        is following. This method can result in exceptions for conditions such as null arguments or if the specified
        user cannot be found.

        :param str account_name: Account name of the specified user.
        :return: BaseEntityCollection
        """
        return_type = BaseEntityCollection(self.context, PersonProperties)
        params = {"accountName": account_name}
        qry = ServiceOperationQuery(self, "GetPeopleFollowedBy", params, None,
                                    None, return_type)
        self.context.add_query(qry)
        return return_type
コード例 #12
0
ファイル: web.py プロジェクト: biancini/TeamsLogExporter
    def get_push_notification_subscribers_by_user(self, user_or_username):
        """

        :param str or User user_or_username:
        """
        return_type = BaseEntityCollection(self.context,
                                           PushNotificationSubscriber)

        if isinstance(user_or_username, User):

            def _user_loaded():
                next_qry = ServiceOperationQuery(
                    self, "GetPushNotificationSubscribersByUser",
                    [user_or_username.login_name], None, None, return_type)
                self.context.add_query(next_qry)

            user_or_username.ensure_property("LoginName", _user_loaded)
        else:
            qry = ServiceOperationQuery(
                self, "GetPushNotificationSubscribersByUser",
                [user_or_username], None, None, return_type)
            self.context.add_query(qry)
        return return_type
コード例 #13
0
 def versions(self):
     """Gets the collection of item version objects that represent the versions of the item."""
     return self.properties.get(
         'Versions',
         BaseEntityCollection(self.context, ListItemVersion,
                              ResourcePath("versions", self.resource_path)))
コード例 #14
0
 def recipients(self):
     return self.properties.get('Recipients',
                                BaseEntityCollection(self.context, TranslationNotificationRecipientUsers,
                                                     ResourcePath("Recipients", self.resource_path)))
コード例 #15
0
 def web_applications(self):
     return self.properties.get(
         'WebApplications',
         BaseEntityCollection(
             self.context, WebApplication,
             ResourcePath("WebApplications", self.resource_path)))
コード例 #16
0
 def sites(self):
     return self.properties.get('Sites',
                                BaseEntityCollection(self.context, Site, ResourcePath("Sites", self.resource_path)))
コード例 #17
0
 def version_events(self):
     return self.properties.get(
         "VersionEvents",
         BaseEntityCollection(
             self.context, FileVersionEvent,
             ResourcePath("VersionEvents", self.resource_path)))