示例#1
0
 def fields(self):
     """A collection of the fields and values for this version of the list item.
     """
     return self.properties.get(
         'fields',
         EntityCollection(self.context, FieldValueSet,
                          ResourcePath("fields", self.resource_path)))
示例#2
0
 def subscriptions(self):
     """The set of subscriptions on the list."""
     return self.get_property(
         'subscriptions',
         EntityCollection(self.context, Subscription,
                          ResourcePath("subscriptions",
                                       self.resource_path)))
示例#3
0
 def messages(self):
     """
     A collection of all the messages in the channel. A navigation property. Nullable.
     """
     return self.properties.get('messages',
                                EntityCollection(self.context, ChatMessage,
                                                 ResourcePath("messages", self.resource_path)))
示例#4
0
 def calendar_groups(self):
     """The user's calendar groups. Read-only. Nullable."""
     return self.properties.get(
         'calendarGroups',
         EntityCollection(
             self.context, CalendarGroup,
             ResourcePath("calendarGroups", self.resource_path)))
示例#5
0
 def contact_folders(self):
     """Get the contact folder collection in the default Contacts folder of the signed-in user."""
     return self.properties.get(
         'contactFolders',
         EntityCollection(
             self.context, ContactFolder,
             ResourcePath("contactFolders", self.resource_path)))
示例#6
0
    def sections(self):
        """Retrieve a list of onenoteSection objects from the specified notebook.

        :rtype: EntityCollection
        """
        return self.get_property('sections', EntityCollection(self.context, OnenoteSection,
                                                              ResourcePath("sections", self.resource_path)))
示例#7
0
 def subscriptions(self):
     """
     Retrieve the properties and relationships of webhook subscriptions,
     based on the app ID, the user, and the user's role with a tenant.
     """
     return EntityCollection(self, Subscription,
                             ResourcePath("subscriptions"))
 def participants(self):
     """
     :rtype: EntityCollection
     """
     return self.get_property('participants',
                              EntityCollection(self.context, Participant,
                                               ResourcePath("participants", self.resource_path)))
 def operations(self):
     """
     :rtype: EntityCollection
     """
     return self.get_property('operations',
                              EntityCollection(self.context, CommsOperation,
                                               ResourcePath("operations", self.resource_path)))
示例#10
0
 def app_definitions(self):
     """The details for each version of the app."""
     return self.get_property(
         'appDefinitions',
         EntityCollection(
             self.context, TeamsAppDefinition,
             ResourcePath("appDefinitions", self.resource_path)))
示例#11
0
    def tasks(self):
        """Read-only. Nullable. Collection of tasks in the plan.

        :rtype: EntityCollection
        """
        return self.get_property('tasks',
                                 EntityCollection(self.context, PlannerTask, ResourcePath("tasks", self.resource_path)))
示例#12
0
 def check_granted_permissions_for_app(self):
     return_type = EntityCollection(self.context,
                                    ResourceSpecificPermissionGrant)
     qry = ServiceOperationQuery(self, "checkGrantedPermissionsForApp",
                                 None, None, None, return_type)
     self.context.add_query(qry)
     return return_type
示例#13
0
 def drives(self):
     """The group's drives. Read-only.
     """
     return self.properties.get(
         'drives',
         EntityCollection(self.context, Drive,
                          ResourcePath("drives", self.resource_path)))
示例#14
0
 def calendar_permissions(self):
     """The permissions of the users with whom the calendar is shared."""
     return self.properties.get(
         'calendarPermissions',
         EntityCollection(
             self.context, CalendarPermission,
             ResourcePath("calendarPermissions", self.resource_path)))
 def versions(self):
     """The list of previous versions of the item. For more info, see getting previous versions.
     Read-only. Nullable."""
     return self.properties.get(
         'versions',
         EntityCollection(self.context, DriveItemVersion,
                          ResourcePath("versions", self.resource_path)))
示例#16
0
 def contacts(self):
     """The contacts in the folder. Navigation property. Read-only. Nullable."""
     from office365.outlook.contacts.contact import Contact
     return self.properties.get(
         'contacts',
         EntityCollection(self.context, Contact,
                          ResourcePath("contacts", self.resource_path)))
 def thumbnails(self):
     """Collection containing ThumbnailSet objects associated with the item. For more info, see getting thumbnails.
     Read-only. Nullable."""
     return self.properties.get(
         'thumbnails',
         EntityCollection(self.context, ThumbnailSet,
                          ResourcePath("thumbnails", self.resource_path)))
    def items(self):
        """All items contained in the drive.

        :rtype: EntityCollection
        """
        return self.get_property('items',
                                 EntityCollection(self.context, DriveItem, ResourcePath("items", self.resource_path)))
示例#19
0
 def following(self):
     """The list of items the user is following. Only in OneDrive for Business.
     """
     return self.properties.get(
         'following',
         EntityCollection(self.context, DriveItem,
                          ResourcePath("following", self.resource_path)))
 def column_positions(self):
     """Column order information in a content type."""
     return self.properties.get(
         'columnPositions',
         EntityCollection(
             self.context, ColumnDefinition,
             ResourcePath("columnPositions", self.resource_path)))
示例#21
0
    def get_calendar_view(self, start_dt, end_dt):
        """Get the occurrences, exceptions, and single instances of events in a calendar view defined by a time range,
           from the user's default calendar, or from some other calendar of the user's.

        :param datetime.datetime end_dt: The end date and time of the time range, represented in ISO 8601 format.
             For example, "2019-11-08T20:00:00-08:00".
        :param datetime.datetime start_dt: The start date and time of the time range, represented in ISO 8601 format.
            For example, "2019-11-08T19:00:00-08:00".

        """
        return_type = EntityCollection(
            self.context, Event,
            ResourcePath("calendarView", self.resource_path))
        qry = ServiceOperationQuery(self, "calendarView", None, None, None,
                                    return_type)
        self.context.add_query(qry)

        def _construct_request(request):
            """
            :type request: office365.runtime.http.request_options.RequestOptions
            """
            request.method = HttpMethod.Get
            request.url += "?startDateTime={0}&endDateTime={1}".format(
                start_dt.isoformat(), end_dt.isoformat())

        self.context.before_execute(_construct_request)
        return return_type
示例#22
0
 def contacts(self):
     """Get a contact collection from the default Contacts folder of the signed-in user (.../me/contacts),
     or from the specified contact folder."""
     return self.properties.get(
         'contacts',
         EntityCollection(self.context, Contact,
                          ResourcePath("contacts", self.resource_path)))
示例#23
0
 def license_details(self):
     """Retrieve the properties and relationships of a Drive resource."""
     return self.properties.get(
         'licenseDetails',
         EntityCollection(
             self.context, LicenseDetails,
             ResourcePath("licenseDetails", self.resource_path)))
示例#24
0
 def identity_providers(self):
     """Represents entry point for identity provider base."""
     return self.properties.get(
         'identityProviders',
         EntityCollection(
             self.context, IdentityProviderBase,
             ResourcePath("identityProviders", self.resource_path)))
 def operations(self):
     """The status of workbook operations. Getting an operation collection is not supported, but you can get the
     status of a long-running operation if the Location header is returned in the response"""
     return self.properties.get(
         'operations',
         EntityCollection(self.context, WorkbookOperation,
                          ResourcePath("operations", self.resource_path)))
    def invite(self,
               recipients,
               message,
               require_sign_in=True,
               send_invitation=True,
               roles=None):
        """Sends a sharing invitation for a driveItem. A sharing invitation provides permissions to the recipients
        and optionally sends them an email with a sharing link.

        :param list[DriveRecipient] recipients: A collection of recipients who will receive access and the sharing
        invitation.
        :param str message: A plain text formatted message that is included in the sharing invitation.
        Maximum length 2000 characters.
        :param bool require_sign_in: Specifies whether the recipient of the invitation is required to sign-in to view
        the shared item.
        :param bool send_invitation: If true, a sharing link is sent to the recipient. Otherwise, a permission is
        granted directly without sending a notification.
        :param list[str] roles: Specify the roles that are to be granted to the recipients of the sharing invitation.
        """
        if roles is None:
            roles = ["read"]
        return_type = EntityCollection(self.context, Permission)
        payload = {
            "requireSignIn": require_sign_in,
            "sendInvitation": send_invitation,
            "roles": roles,
            "recipients": recipients,
            "message": message
        }
        qry = ServiceOperationQuery(self, "invite", payload, None, None,
                                    return_type)
        self.context.add_query(qry)
        return return_type
示例#27
0
 def relations(self):
     """To indicate which terms are related to the current term as either pinned or reused."""
     from office365.onedrive.termstore.relation import Relation
     return self.properties.get(
         'relations',
         EntityCollection(self.context, Relation,
                          ResourcePath("relations", self.resource_path)))
    def get_activities_by_interval(self,
                                   start_dt=None,
                                   end_dt=None,
                                   interval=None):
        """
        Get a collection of itemActivityStats resources for the activities that took place on this resource
        within the specified time interval.

        :param datetime.datetime start_dt: The start time over which to aggregate activities.
        :param datetime.datetime end_dt: The end time over which to aggregate activities.
        :param str interval: The aggregation interval.
        """
        params = {
            "startDateTime":
            start_dt.strftime('%m-%d-%Y') if start_dt else None,
            "endDateTime": end_dt.strftime('%m-%d-%Y') if end_dt else None,
            "interval": interval
        }
        return_type = EntityCollection(
            self.context, ItemActivityStat,
            ServiceOperationPath("getActivitiesByInterval", params,
                                 self.resource_path))
        qry = ServiceOperationQuery(self, "getActivitiesByInterval", params,
                                    None, None, return_type)
        self.context.add_query(qry)

        def _construct_request(request):
            request.method = HttpMethod.Get

        self.context.before_execute(_construct_request)
        return return_type
示例#29
0
 def operations(self):
     """
     A collection of all the Teams async operations that ran or are running on the chat. Nullable.
     """
     return self.properties.get('operations',
                                EntityCollection(self.context, TeamsAsyncOperation,
                                                 ResourcePath("operations", self.resource_path)))
 def section_groups(self):
     """Retrieve a list of onenoteSection objects from the specified notebook."""
     return self.properties.get(
         'sectionGroups',
         EntityCollection(self.context, SectionGroup,
                          ResourcePath("sectionGroups",
                                       self.resource_path)))