Office365-REST-Python-Client 2.4.2__py3-none-any.whl → 2.4.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {Office365_REST_Python_Client-2.4.2.dist-info → Office365_REST_Python_Client-2.4.4.dist-info}/METADATA +65 -31
- {Office365_REST_Python_Client-2.4.2.dist-info → Office365_REST_Python_Client-2.4.4.dist-info}/RECORD +401 -259
- office365/base_item.py +27 -5
- office365/booking/business.py +7 -0
- office365/booking/currency.py +5 -0
- office365/booking/solutions_root.py +32 -0
- office365/communications/calls/invitation_participant_info.py +17 -1
- office365/communications/calls/options.py +9 -0
- office365/communications/onlinemeetings/provider_type.py +3 -0
- office365/communications/presences/presence.py +14 -0
- office365/communications/presences/status_message.py +12 -0
- office365/directory/administrative_unit.py +22 -0
- office365/directory/applications/collection.py +2 -1
- office365/directory/applications/roles/assignment.py +45 -5
- office365/directory/applications/roles/assignment_collection.py +8 -0
- office365/directory/applications/roles/role.py +6 -1
- office365/directory/audit/signins/activity.py +31 -0
- office365/directory/audit/signins/location.py +17 -0
- office365/directory/audit/signins/signin.py +33 -0
- office365/directory/authentication/authentication.py +9 -0
- office365/directory/authentication/methods/details.py +25 -0
- office365/directory/authentication/methods/email.py +16 -0
- office365/directory/authentication/methods/root.py +27 -0
- office365/directory/certificates/authority.py +6 -1
- office365/directory/extensions/extended_property.py +8 -1
- office365/directory/extensions/extension.py +1 -1
- office365/directory/extensions/extension_property.py +0 -3
- office365/directory/extensions/open_type.py +8 -0
- office365/directory/groups/collection.py +2 -4
- office365/directory/groups/group.py +18 -4
- office365/directory/identities/governance.py +2 -0
- office365/directory/identities/object_identity.py +3 -3
- office365/directory/insights/resource_reference.py +15 -0
- office365/directory/insights/shared.py +36 -0
- office365/directory/insights/sharing_detail.py +11 -0
- office365/directory/insights/trending.py +8 -0
- office365/directory/insights/usage_details.py +16 -0
- office365/directory/insights/used.py +30 -0
- office365/directory/invitations/invitation.py +33 -1
- office365/directory/licenses/assigned_plan.py +19 -1
- office365/directory/licenses/assignment_state.py +5 -0
- office365/directory/licenses/service_plan_info.py +4 -0
- office365/directory/licenses/subscribed_sku.py +41 -0
- office365/directory/licenses/units_detail.py +11 -0
- office365/directory/object.py +3 -1
- office365/directory/object_collection.py +3 -4
- office365/directory/password_credential.py +5 -1
- office365/directory/permissions/email_identity.py +5 -0
- office365/directory/permissions/grants/condition_set.py +26 -0
- office365/directory/permissions/grants/resource_specific.py +21 -0
- office365/directory/policies/authentication_flows.py +9 -0
- office365/directory/policies/authentication_strength.py +10 -0
- office365/directory/policies/authorization.py +8 -0
- office365/directory/policies/cross_tenant_access.py +5 -0
- office365/directory/policies/root.py +35 -2
- office365/directory/protection/information.py +5 -0
- office365/directory/protection/risk_detection.py +11 -0
- office365/directory/protection/riskyusers/activity.py +5 -0
- office365/directory/protection/riskyusers/collection.py +32 -0
- office365/directory/protection/riskyusers/history_item.py +20 -0
- office365/directory/protection/riskyusers/risky_user.py +26 -0
- office365/directory/protection/root.py +31 -0
- office365/directory/rolemanagement/application.py +35 -0
- office365/directory/{roles → rolemanagement}/management.py +8 -1
- office365/directory/{roles → rolemanagement}/role.py +14 -0
- office365/directory/{roles → rolemanagement}/template.py +8 -0
- office365/directory/rolemanagement/unified_role_assignment.py +45 -0
- office365/directory/rolemanagement/unified_role_definition.py +6 -0
- office365/directory/security/alerts/alert.py +21 -0
- office365/directory/security/alerts/history_state.py +5 -0
- office365/directory/security/attacksimulations/automation.py +21 -0
- office365/directory/security/attacksimulations/automation_run.py +5 -0
- office365/directory/security/attacksimulations/repeat_offender.py +6 -0
- office365/directory/security/attacksimulations/root.py +26 -0
- office365/directory/security/attacksimulations/simulation.py +17 -0
- office365/directory/security/cases/__init__.py +0 -0
- office365/directory/security/cases/ediscovery.py +6 -0
- office365/directory/security/cases/root.py +22 -0
- office365/directory/security/incidents/incident.py +67 -0
- office365/directory/security/security.py +10 -1
- office365/directory/serviceprincipals/service_principal.py +89 -4
- office365/directory/synchronization/__init__.py +0 -0
- office365/directory/synchronization/job.py +16 -0
- office365/directory/synchronization/progress.py +5 -0
- office365/directory/synchronization/status.py +13 -0
- office365/directory/synchronization/synchronization.py +24 -0
- office365/directory/tenant_information.py +17 -0
- office365/directory/tenant_relationship.py +21 -0
- office365/directory/users/activities/activity.py +45 -1
- office365/directory/users/collection.py +8 -0
- office365/directory/users/password_profile.py +18 -2
- office365/directory/users/user.py +254 -29
- office365/entity.py +3 -3
- office365/graph_client.py +64 -12
- office365/intune/audit/actor.py +5 -0
- office365/intune/audit/event.py +21 -24
- office365/intune/audit/event_collection.py +26 -0
- office365/intune/audit/property.py +5 -0
- office365/intune/audit/resource.py +11 -0
- office365/intune/brand.py +6 -0
- office365/intune/devices/compliance/__init__.py +0 -0
- office365/intune/devices/compliance/policy.py +6 -0
- office365/intune/devices/compliance/policy_state.py +5 -0
- office365/intune/devices/data.py +5 -0
- office365/intune/devices/detail.py +10 -0
- office365/intune/devices/enrollment/__init__.py +0 -0
- office365/intune/devices/enrollment/configuration.py +25 -0
- office365/intune/devices/enrollment/configuration_assignment.py +5 -0
- office365/intune/devices/enrollment/limit_configuration.py +5 -0
- office365/intune/devices/managed.py +44 -3
- office365/intune/devices/management/__init__.py +0 -0
- office365/intune/devices/management/management.py +69 -0
- office365/intune/devices/management/reports/__init__.py +0 -0
- office365/intune/devices/management/reports/reports.py +5 -0
- office365/intune/devices/management/settings.py +18 -0
- office365/intune/organizations/branding.py +15 -0
- office365/intune/organizations/organization.py +14 -0
- office365/intune/printing/__init__.py +0 -0
- office365/intune/printing/base.py +11 -0
- office365/intune/printing/capabilities.py +5 -0
- office365/intune/printing/connectors/__init__.py +0 -0
- office365/intune/printing/connectors/connector.py +6 -0
- office365/intune/printing/operations/__init__.py +0 -0
- office365/intune/printing/print.py +24 -0
- office365/intune/printing/printer.py +6 -0
- office365/intune/printing/services/__init__.py +0 -0
- office365/intune/printing/services/endpoint.py +5 -0
- office365/intune/printing/services/service.py +17 -0
- office365/intune/printing/share.py +5 -0
- office365/intune/printing/shares/__init__.py +0 -0
- office365/intune/printing/taskdefinitions/__init__.py +0 -0
- office365/intune/provisioned_plan.py +5 -1
- office365/intune/servicecommunications/__init__.py +0 -0
- office365/intune/servicecommunications/announcement.py +39 -0
- office365/intune/servicecommunications/announcement_base.py +5 -0
- office365/intune/servicecommunications/health/__init__.py +0 -0
- office365/intune/servicecommunications/health/health.py +7 -0
- office365/intune/servicecommunications/issues/__init__.py +0 -0
- office365/intune/servicecommunications/issues/issue.py +29 -0
- office365/intune/servicecommunications/messages/__init__.py +0 -0
- office365/intune/servicecommunications/messages/update.py +10 -0
- office365/intune/termsandconditions/__init__.py +0 -0
- office365/intune/vpp_token.py +10 -0
- office365/onedrive/admin.py +16 -0
- office365/onedrive/columns/content_approval_status.py +5 -0
- office365/onedrive/columns/datetime.py +15 -0
- office365/onedrive/columns/default_value.py +4 -0
- office365/onedrive/columns/definition.py +49 -3
- office365/onedrive/columns/definition_collection.py +17 -6
- office365/onedrive/columns/lookup.py +5 -1
- office365/onedrive/columns/types.py +13 -0
- office365/onedrive/contenttypes/content_type.py +8 -0
- office365/onedrive/driveitems/audio.py +12 -1
- office365/onedrive/driveitems/driveItem.py +147 -69
- office365/onedrive/driveitems/image.py +8 -1
- office365/onedrive/driveitems/item_preview_info.py +20 -2
- office365/onedrive/driveitems/remote_item.py +19 -4
- office365/onedrive/drives/drive.py +7 -1
- office365/onedrive/drives/quota.py +18 -0
- office365/onedrive/drives/recipient.py +4 -0
- office365/onedrive/files/system_info.py +8 -6
- office365/onedrive/folders/folder.py +3 -3
- office365/onedrive/internal/paths/children.py +1 -4
- office365/onedrive/internal/paths/shared.py +7 -2
- office365/onedrive/lists/collection.py +12 -6
- office365/onedrive/lists/list.py +13 -5
- office365/onedrive/operations/long_running.py +7 -0
- office365/onedrive/operations/pending.py +13 -0
- office365/onedrive/operations/pending_content_update.py +5 -0
- office365/onedrive/permissions/collection.py +5 -6
- office365/onedrive/permissions/sharing_link.py +16 -1
- office365/onedrive/sensitivitylabels/__init__.py +0 -0
- office365/onedrive/sensitivitylabels/assignment.py +17 -0
- office365/onedrive/sensitivitylabels/assignment_method.py +4 -0
- office365/onedrive/sensitivitylabels/extract_result.py +13 -0
- office365/onedrive/sharepoint_settings.py +25 -0
- office365/onedrive/sites/sites_with_root.py +11 -1
- office365/onedrive/termstore/groups/collection.py +1 -1
- office365/onedrive/termstore/groups/group.py +1 -0
- office365/onedrive/termstore/sets/collection.py +1 -1
- office365/onenote/operations/operation.py +10 -1
- office365/onenote/resources/resource.py +1 -0
- office365/outlook/calendar/calendar.py +116 -6
- office365/outlook/calendar/dateTimeTimeZone.py +4 -0
- office365/outlook/calendar/email_address.py +7 -0
- office365/outlook/calendar/events/event.py +0 -4
- office365/outlook/calendar/events/reminder.py +22 -3
- office365/outlook/calendar/group.py +0 -2
- office365/outlook/calendar/location_constraint.py +16 -1
- office365/outlook/calendar/meetingtimes/activity_domain.py +10 -0
- office365/outlook/calendar/meetingtimes/suggestion.py +1 -1
- office365/outlook/calendar/meetingtimes/time_constraint.py +18 -0
- office365/outlook/calendar/permissions/__init__.py +0 -0
- office365/outlook/calendar/permissions/collection.py +24 -0
- office365/outlook/calendar/{permission.py → permissions/permission.py} +35 -2
- office365/outlook/calendar/place.py +7 -0
- office365/outlook/calendar/role_type.py +17 -0
- office365/outlook/calendar/schedule/information.py +5 -4
- office365/outlook/calendar/schedule/item.py +20 -1
- office365/outlook/calendar/sharing_message.py +2 -2
- office365/outlook/calendar/time_zone_base.py +3 -0
- office365/outlook/calendar/working_hours.py +17 -1
- office365/outlook/contacts/collection.py +39 -0
- office365/outlook/contacts/contact.py +21 -11
- office365/outlook/geo_coordinates.py +20 -0
- office365/outlook/item.py +5 -4
- office365/outlook/locale_info.py +3 -0
- office365/outlook/mail/automatic_replies_setting.py +14 -0
- office365/outlook/mail/folders/folder.py +52 -3
- office365/outlook/mail/folders/search.py +11 -0
- office365/outlook/mail/importance.py +1 -0
- office365/outlook/mail/item_body.py +3 -0
- office365/outlook/mail/location.py +27 -2
- office365/outlook/mail/location_constraint_item.py +5 -0
- office365/outlook/mail/mailbox_settings.py +13 -1
- office365/outlook/mail/messages/collection.py +7 -0
- office365/outlook/mail/messages/followup_flag.py +21 -0
- office365/outlook/mail/messages/internet_header.py +16 -0
- office365/outlook/mail/messages/message.py +184 -6
- office365/outlook/mail/messages/rules/__init__.py +0 -0
- office365/outlook/mail/messages/rules/actions.py +38 -0
- office365/outlook/mail/messages/rules/predicates.py +5 -0
- office365/outlook/mail/messages/rules/rule.py +32 -0
- office365/outlook/mail/patterned_recurrence.py +14 -1
- office365/outlook/mail/physical_address.py +5 -1
- office365/outlook/mail/recipient.py +3 -0
- office365/outlook/mail/recurrence_pattern.py +18 -1
- office365/outlook/mail/recurrence_range.py +16 -2
- office365/outlook/timezone_information.py +3 -0
- office365/reports/root.py +28 -1
- office365/reports/security/__init__.py +0 -0
- office365/reports/security/root.py +21 -0
- office365/reports/userregistration/__init__.py +0 -0
- office365/reports/userregistration/method_count.py +17 -0
- office365/reports/userregistration/method_summary.py +21 -0
- office365/runtime/auth/authentication_context.py +123 -25
- office365/runtime/auth/client_credential.py +2 -2
- office365/runtime/auth/providers/acs_token_provider.py +6 -3
- office365/runtime/auth/providers/saml_token_provider.py +10 -7
- office365/runtime/auth/token_response.py +3 -3
- office365/runtime/client_object_collection.py +12 -7
- office365/runtime/client_result.py +9 -0
- office365/runtime/client_runtime_context.py +10 -8
- office365/runtime/http/request_options.py +2 -1
- office365/runtime/odata/request.py +4 -4
- office365/runtime/paths/appid.py +2 -1
- office365/runtime/paths/entity.py +2 -2
- office365/{sharepoint/internal/paths/entity.py → runtime/paths/key.py} +5 -3
- office365/runtime/paths/resource_path.py +3 -0
- office365/runtime/types/event_handler.py +6 -0
- office365/search/external/__init__.py +0 -0
- office365/search/external/configuration.py +8 -0
- office365/search/external/connection.py +27 -0
- office365/{external → search/external}/external.py +1 -1
- office365/search/external/search_settings.py +5 -0
- office365/search/query.py +3 -1
- office365/search/request.py +3 -1
- office365/search/sharepoint_onedrive_options.py +3 -0
- office365/search/sort_property.py +9 -0
- office365/sharepoint/activities/client_request.py +4 -1
- office365/sharepoint/activities/logger.py +25 -0
- office365/sharepoint/activities/revision_info.py +9 -0
- office365/sharepoint/addtoonedrive/mount_point.py +25 -0
- office365/sharepoint/addtoonedrive/mounted_folder_info.py +5 -0
- office365/sharepoint/alerts/alert.py +31 -0
- office365/sharepoint/apps/license_collection.py +1 -2
- office365/sharepoint/changes/item.py +14 -0
- office365/sharepoint/client_context.py +91 -30
- office365/sharepoint/clientsidecomponent/component_context_info.py +7 -0
- office365/sharepoint/clientsidecomponent/identifier.py +3 -0
- office365/sharepoint/compliance/tag_info.py +17 -0
- office365/sharepoint/contenttypes/collection.py +6 -7
- office365/sharepoint/contenttypes/content_type.py +49 -1
- office365/sharepoint/contenttypes/fieldlinks/collection.py +5 -6
- office365/sharepoint/features/known_list.py +2 -0
- office365/sharepoint/fields/collection.py +70 -39
- office365/sharepoint/fields/computed.py +5 -2
- office365/sharepoint/fields/creation_information.py +5 -4
- office365/sharepoint/fields/field.py +73 -15
- office365/sharepoint/fields/user.py +3 -3
- office365/sharepoint/files/checked_out_file.py +3 -2
- office365/sharepoint/files/file.py +9 -4
- office365/sharepoint/files/versions/version.py +7 -9
- office365/sharepoint/folders/collection.py +2 -2
- office365/sharepoint/folders/coloring.py +39 -0
- office365/sharepoint/folders/coloring_information.py +15 -0
- office365/sharepoint/folders/folder.py +21 -10
- office365/sharepoint/forms/customization.py +8 -0
- office365/sharepoint/listitems/listitem.py +29 -10
- office365/sharepoint/lists/bloom_filter.py +0 -1
- office365/sharepoint/lists/creation_information.py +18 -4
- office365/sharepoint/lists/list.py +203 -27
- office365/sharepoint/lists/render_data_parameters.py +21 -1
- office365/sharepoint/lists/template_type.py +10 -0
- office365/sharepoint/navigation/configured_metadata_items.py +25 -1
- office365/sharepoint/navigation/metadata_settings.py +6 -4
- office365/sharepoint/permissions/irm/file_settings.py +43 -0
- office365/sharepoint/permissions/securable_object.py +5 -6
- office365/sharepoint/portal/sites/manager.py +5 -6
- office365/sharepoint/portal/userprofiles/documents_shared_with_group.py +3 -0
- office365/sharepoint/publishing/base_custom_property.py +8 -0
- office365/sharepoint/publishing/navigation/structural_navigation_cache_wrapper.py +8 -0
- office365/sharepoint/publishing/pagecopywithassets/__init__.py +0 -0
- office365/sharepoint/publishing/pagecopywithassets/response.py +8 -0
- office365/sharepoint/publishing/pages/campaign_publication.py +7 -0
- office365/sharepoint/publishing/pages/collection.py +1 -1
- office365/sharepoint/publishing/pages/page.py +4 -1
- office365/sharepoint/publishing/pages/reposts/metadata.py +8 -0
- office365/sharepoint/publishing/personmagazine/person_magazine.py +4 -1
- office365/sharepoint/search/administration/tenant_crawl_versions_info_provider.py +8 -1
- office365/sharepoint/search/query/auto_completion_match.py +3 -0
- office365/sharepoint/search/query/property_value.py +18 -0
- office365/sharepoint/search/request.py +16 -2
- office365/sharepoint/sharing/abilities.py +22 -0
- office365/sharepoint/sharing/direct_abilities.py +27 -0
- office365/sharepoint/sharing/link_abilities.py +9 -1
- office365/sharepoint/sharing/links/data.py +26 -1
- office365/sharepoint/sharing/links/info.py +1 -1
- office365/sharepoint/sharing/links/partial_success_response.py +5 -0
- office365/sharepoint/sharing/links/share_settings.py +24 -1
- office365/sharepoint/sharing/object_sharing_information.py +65 -2
- office365/sharepoint/sharing/object_sharing_information_user.py +9 -0
- office365/sharepoint/sharing/object_sharing_settings.py +17 -4
- office365/sharepoint/sharing/principal.py +10 -0
- office365/sharepoint/sharing/securable_object_extensions.py +1 -17
- office365/sharepoint/sharing/site_sharing_report_helper.py +2 -1
- office365/sharepoint/sharing/user_sharing_result.py +18 -8
- office365/sharepoint/sitehealth/result.py +10 -0
- office365/sharepoint/sites/language.py +11 -1
- office365/sharepoint/sites/language_collection.py +1 -0
- office365/sharepoint/sites/site.py +42 -7
- office365/sharepoint/taxonomy/create_xml_parameters.py +22 -15
- office365/sharepoint/taxonomy/field.py +10 -8
- office365/sharepoint/taxonomy/groups/collection.py +8 -1
- office365/sharepoint/taxonomy/groups/group.py +26 -0
- office365/sharepoint/taxonomy/sets/collection.py +15 -0
- office365/sharepoint/taxonomy/sets/name.py +23 -0
- office365/sharepoint/taxonomy/sets/set.py +16 -1
- office365/sharepoint/taxonomy/stores/store.py +0 -8
- office365/sharepoint/tenant/administration/audit/search_request_status.py +8 -0
- office365/sharepoint/tenant/administration/deny_add_and_customize_pages_status.py +3 -0
- office365/sharepoint/tenant/administration/hubsites/permission.py +10 -0
- office365/sharepoint/tenant/administration/sites/properties.py +12 -10
- office365/sharepoint/tenant/administration/tenant.py +2 -1
- office365/sharepoint/tenant/apps/information.py +3 -1
- office365/sharepoint/tenant/management/office365_tenant.py +14 -11
- office365/sharepoint/types/resource_path.py +3 -1
- office365/sharepoint/userprofiles/people_manager.py +0 -2
- office365/sharepoint/userprofiles/sharedwithme/document.py +16 -0
- office365/sharepoint/userprofiles/sharedwithme/document_user.py +12 -0
- office365/sharepoint/userprofiles/sharedwithme/item_collection.py +41 -0
- office365/sharepoint/userprofiles/sharedwithme/items.py +18 -1
- office365/sharepoint/viva/site_manager.py +14 -0
- office365/sharepoint/webhooks/subscription_collection.py +5 -6
- office365/sharepoint/webparts/definition.py +1 -1
- office365/sharepoint/webparts/webpart.py +18 -4
- office365/sharepoint/webs/context_web_information.py +2 -4
- office365/sharepoint/webs/web.py +31 -12
- office365/sharepoint/workflowservices/manager.py +0 -2
- office365/subscriptions/collection.py +42 -0
- office365/subscriptions/subscription.py +120 -2
- office365/teams/apps/catalog.py +23 -0
- office365/teams/associated_info.py +12 -0
- office365/teams/channels/channel.py +2 -3
- office365/teams/channels/collection.py +1 -1
- office365/teams/channels/iIdentity.py +5 -0
- office365/teams/chats/chat.py +12 -2
- office365/teams/chats/collection.py +1 -2
- office365/teams/chats/messages/__init__.py +0 -0
- office365/teams/chats/messages/info.py +14 -0
- office365/teams/chats/{message.py → messages/message.py} +18 -3
- office365/teams/info.py +20 -0
- office365/teams/members/aad_user_conversation.py +2 -2
- office365/teams/members/conversation_collection.py +3 -3
- office365/teams/schedule/change_request.py +4 -2
- office365/teams/schedule/change_tracked_entity.py +11 -2
- office365/teams/summary.py +15 -0
- office365/teams/tabs/configuration.py +12 -1
- office365/teams/tabs/tab.py +0 -1
- office365/teams/team.py +34 -1
- office365/teams/teamwork/__init__.py +0 -0
- office365/teams/teamwork/activity_topic.py +5 -0
- office365/teams/teamwork/tags/__init__.py +0 -0
- office365/teams/teamwork/tags/identity.py +6 -0
- office365/teams/teamwork/tags/member.py +5 -0
- office365/teams/teamwork/tags/tag.py +15 -0
- office365/{directory/security/cases_root.py → teams/viva/employee_experience_user.py} +1 -1
- office365/todo/attachments/session.py +34 -0
- office365/todo/linked_resource.py +10 -1
- office365/todo/tasks/task.py +4 -0
- office365/directory/identities/protection_root.py +0 -5
- office365/directory/rbac/application.py +0 -18
- office365/directory/rbac/unified_role_assignment.py +0 -8
- office365/external/connection.py +0 -5
- office365/intune/devices/management.py +0 -35
- office365/onedrive/internal/queries/download_content.py +0 -26
- office365/onedrive/internal/queries/upload_content.py +0 -23
- office365/outlook/mail/messages/message_rule.py +0 -15
- office365/runtime/auth/providers/oauth_token_provider.py +0 -25
- office365/teams/team_info.py +0 -6
- {Office365_REST_Python_Client-2.4.2.dist-info → Office365_REST_Python_Client-2.4.4.dist-info}/LICENSE +0 -0
- {Office365_REST_Python_Client-2.4.2.dist-info → Office365_REST_Python_Client-2.4.4.dist-info}/WHEEL +0 -0
- {Office365_REST_Python_Client-2.4.2.dist-info → Office365_REST_Python_Client-2.4.4.dist-info}/top_level.txt +0 -0
- /office365/{directory/rbac → booking}/__init__.py +0 -0
- /office365/directory/{roles → protection}/__init__.py +0 -0
- /office365/{external → directory/protection/riskyusers}/__init__.py +0 -0
- /office365/{teams/messages → directory/rolemanagement}/__init__.py +0 -0
- /office365/outlook/calendar/{time_slot.py → meetingtimes/time_slot.py} +0 -0
- /office365/teams/chats/{message_attachment.py → messages/attachment.py} +0 -0
- /office365/teams/{member_settings.py → members/settings.py} +0 -0
- /office365/teams/{user_teamwork.py → teamwork/user.py} +0 -0
|
@@ -1,27 +1,33 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import sys
|
|
3
|
+
|
|
1
4
|
from office365.runtime.auth.client_credential import ClientCredential
|
|
2
5
|
from office365.runtime.auth.providers.acs_token_provider import ACSTokenProvider
|
|
3
|
-
from office365.runtime.auth.providers.oauth_token_provider import OAuthTokenProvider
|
|
4
6
|
from office365.runtime.auth.providers.saml_token_provider import SamlTokenProvider
|
|
5
7
|
from office365.runtime.auth.token_response import TokenResponse
|
|
6
8
|
from office365.runtime.auth.user_credential import UserCredential
|
|
7
9
|
from office365.runtime.compat import get_absolute_url
|
|
8
10
|
|
|
9
11
|
|
|
12
|
+
def _get_authorization_header(token):
|
|
13
|
+
return '{token_type} {access_token}'.format(token_type=token.tokenType, access_token=token.accessToken)
|
|
14
|
+
|
|
15
|
+
|
|
10
16
|
class AuthenticationContext(object):
|
|
17
|
+
"""Authentication context for SharePoint Online/OneDrive For Business"""
|
|
11
18
|
|
|
12
19
|
def __init__(self, url):
|
|
13
20
|
"""
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
:param str url: Absolute Web or Site Url
|
|
21
|
+
:param str url: SharePoint absolute web or site Url
|
|
17
22
|
"""
|
|
18
23
|
self.url = url.rstrip("/")
|
|
19
|
-
self.
|
|
24
|
+
self._authenticate = None
|
|
25
|
+
self._cached_token = None
|
|
20
26
|
|
|
21
27
|
def with_client_certificate(self, tenant, client_id, thumbprint, cert_path=None, private_key=None, scopes=None):
|
|
22
|
-
"""
|
|
28
|
+
"""Initializes a client to acquire a token via certificate credentials
|
|
23
29
|
|
|
24
|
-
:param str tenant: Tenant name, for example
|
|
30
|
+
:param str tenant: Tenant name, for example: contoso.onmicrosoft.com
|
|
25
31
|
:param str client_id: The OAuth client id of the calling application.
|
|
26
32
|
:param str thumbprint: Hex encoded thumbprint of the certificate.
|
|
27
33
|
:param str or None cert_path: Path to A PEM encoded certificate private key.
|
|
@@ -37,7 +43,7 @@ class AuthenticationContext(object):
|
|
|
37
43
|
with open(cert_path, 'r') as f:
|
|
38
44
|
private_key = f.read()
|
|
39
45
|
|
|
40
|
-
def
|
|
46
|
+
def _acquire_token():
|
|
41
47
|
authority_url = 'https://login.microsoftonline.com/{0}'.format(tenant)
|
|
42
48
|
credentials = {"thumbprint": thumbprint, "private_key": private_key}
|
|
43
49
|
import msal
|
|
@@ -49,49 +55,141 @@ class AuthenticationContext(object):
|
|
|
49
55
|
result = app.acquire_token_for_client(scopes)
|
|
50
56
|
return TokenResponse.from_json(result)
|
|
51
57
|
|
|
52
|
-
self.with_access_token(
|
|
58
|
+
self.with_access_token(_acquire_token)
|
|
59
|
+
return self
|
|
60
|
+
|
|
61
|
+
def with_interactive(self, tenant, client_id, scopes=None):
|
|
62
|
+
"""
|
|
63
|
+
Initializes a client to acquire a token interactively i.e. via a local browser.
|
|
64
|
+
|
|
65
|
+
Prerequisite: In Azure Portal, configure the Redirect URI of your
|
|
66
|
+
"Mobile and Desktop application" as ``http://localhost``.
|
|
67
|
+
|
|
68
|
+
:param str tenant: Tenant name, for example: contoso.onmicrosoft.com
|
|
69
|
+
:param str client_id: The OAuth client id of the calling application.
|
|
70
|
+
:param list[str] or None scopes: Scopes requested to access a protected API (a resource)
|
|
71
|
+
"""
|
|
72
|
+
if scopes is None:
|
|
73
|
+
resource = get_absolute_url(self.url)
|
|
74
|
+
scopes = ["{url}/.default".format(url=resource)]
|
|
75
|
+
|
|
76
|
+
def _acquire_token():
|
|
77
|
+
import msal
|
|
78
|
+
app = msal.PublicClientApplication(
|
|
79
|
+
client_id,
|
|
80
|
+
authority='https://login.microsoftonline.com/{0}'.format(tenant),
|
|
81
|
+
client_credential=None
|
|
82
|
+
)
|
|
83
|
+
result = app.acquire_token_interactive(scopes=scopes)
|
|
84
|
+
return TokenResponse.from_json(result)
|
|
85
|
+
self.with_access_token(_acquire_token)
|
|
86
|
+
return self
|
|
87
|
+
|
|
88
|
+
def with_device_flow(self, tenant, client_id, scopes=None):
|
|
89
|
+
"""
|
|
90
|
+
Obtain token by a device flow object, with customizable polling effect.
|
|
91
|
+
|
|
92
|
+
:param str tenant: Tenant name, for example: contoso.onmicrosoft.com
|
|
93
|
+
:param str client_id: The OAuth client id of the calling application.
|
|
94
|
+
:param list[str] or None scopes: Scopes requested to access a protected API (a resource)
|
|
95
|
+
"""
|
|
96
|
+
if scopes is None:
|
|
97
|
+
resource = get_absolute_url(self.url)
|
|
98
|
+
scopes = ["{url}/.default".format(url=resource)]
|
|
99
|
+
|
|
100
|
+
def _acquire_token():
|
|
101
|
+
import msal
|
|
102
|
+
app = msal.PublicClientApplication(
|
|
103
|
+
client_id,
|
|
104
|
+
authority='https://login.microsoftonline.com/{0}'.format(tenant),
|
|
105
|
+
client_credential=None
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
flow = app.initiate_device_flow(scopes=scopes)
|
|
109
|
+
if "user_code" not in flow:
|
|
110
|
+
raise ValueError(
|
|
111
|
+
"Failed to create device flow: %s" % json.dumps(flow, indent=4))
|
|
112
|
+
|
|
113
|
+
print(flow["message"])
|
|
114
|
+
sys.stdout.flush()
|
|
115
|
+
|
|
116
|
+
result = app.acquire_token_by_device_flow(flow)
|
|
117
|
+
return TokenResponse.from_json(result)
|
|
118
|
+
self.with_access_token(_acquire_token)
|
|
53
119
|
return self
|
|
54
120
|
|
|
55
121
|
def with_access_token(self, token_func):
|
|
56
|
-
|
|
122
|
+
"""
|
|
123
|
+
Initializes a client to acquire a token from a callback
|
|
124
|
+
|
|
125
|
+
:param () -> dict token_func: A callback
|
|
126
|
+
"""
|
|
127
|
+
def _authenticate(request):
|
|
128
|
+
if self._cached_token is None:
|
|
129
|
+
self._cached_token = token_func()
|
|
130
|
+
request.set_header('Authorization', _get_authorization_header(self._cached_token))
|
|
131
|
+
self._authenticate = _authenticate
|
|
57
132
|
|
|
58
133
|
def with_credentials(self, credentials, **kwargs):
|
|
134
|
+
"""
|
|
135
|
+
Initializes a client to acquire a token via user or client credentials
|
|
136
|
+
|
|
137
|
+
:param UserCredential or ClientCredential credentials:
|
|
138
|
+
"""
|
|
59
139
|
if isinstance(credentials, ClientCredential):
|
|
60
|
-
|
|
140
|
+
provider = ACSTokenProvider(self.url, credentials.clientId, credentials.clientSecret)
|
|
61
141
|
elif isinstance(credentials, UserCredential):
|
|
62
142
|
allow_ntlm = kwargs.get('allow_ntlm', False)
|
|
63
143
|
if allow_ntlm:
|
|
64
144
|
from office365.runtime.auth.providers.ntlm_provider import NtlmProvider
|
|
65
|
-
|
|
145
|
+
provider = NtlmProvider(credentials.userName, credentials.password)
|
|
66
146
|
else:
|
|
67
147
|
browser_mode = kwargs.get('browser_mode', False)
|
|
68
|
-
|
|
148
|
+
provider = SamlTokenProvider(self.url, credentials.userName, credentials.password, browser_mode)
|
|
69
149
|
else:
|
|
70
150
|
raise ValueError("Unknown credential type")
|
|
71
151
|
|
|
152
|
+
def _authenticate(request):
|
|
153
|
+
provider.authenticate_request(request)
|
|
154
|
+
self._authenticate = _authenticate
|
|
155
|
+
|
|
72
156
|
def acquire_token_for_user(self, username, password, browser_mode=False):
|
|
73
|
-
"""
|
|
157
|
+
"""
|
|
158
|
+
Initializes a client to acquire a token via user credentials
|
|
74
159
|
Status: deprecated!
|
|
75
160
|
|
|
76
|
-
:
|
|
77
|
-
:
|
|
78
|
-
:
|
|
161
|
+
:param str password: The user password
|
|
162
|
+
:param str username: Typically a UPN in the form of an email address
|
|
163
|
+
:param bool browser_mode:
|
|
79
164
|
"""
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
165
|
+
provider = SamlTokenProvider(self.url, username, password, browser_mode)
|
|
166
|
+
|
|
167
|
+
def _authenticate(request):
|
|
168
|
+
provider.authenticate_request(request)
|
|
169
|
+
self._authenticate = _authenticate
|
|
170
|
+
return self
|
|
83
171
|
|
|
84
172
|
def acquire_token_for_app(self, client_id, client_secret):
|
|
85
|
-
"""
|
|
173
|
+
"""
|
|
174
|
+
Initializes a client to acquire a token via client credentials (SharePoint App-Only)
|
|
175
|
+
|
|
86
176
|
Status: deprecated!
|
|
177
|
+
|
|
178
|
+
:param str client_id: The OAuth client id of the calling application.
|
|
179
|
+
:param str client_secret: Secret string that the application uses to prove its identity when requesting a token
|
|
87
180
|
"""
|
|
88
|
-
|
|
89
|
-
|
|
181
|
+
provider = ACSTokenProvider(self.url, client_id, client_secret)
|
|
182
|
+
|
|
183
|
+
def _authenticate(request):
|
|
184
|
+
provider.authenticate_request(request)
|
|
185
|
+
self._authenticate = _authenticate
|
|
186
|
+
return self
|
|
90
187
|
|
|
91
188
|
def authenticate_request(self, request):
|
|
92
189
|
"""
|
|
93
190
|
Authenticate request
|
|
94
|
-
|
|
95
191
|
:type request: office365.runtime.http.request_options.RequestOptions
|
|
96
192
|
"""
|
|
97
|
-
self.
|
|
193
|
+
if self._authenticate is None:
|
|
194
|
+
raise ValueError("Authentication credentials are missing or invalid")
|
|
195
|
+
self._authenticate(request)
|
|
@@ -12,9 +12,9 @@ class ACSTokenProvider(AuthenticationProvider, office365.logger.LoggerContext):
|
|
|
12
12
|
"""
|
|
13
13
|
Provider to acquire the access token from a Microsoft Azure Access Control Service (ACS)
|
|
14
14
|
|
|
15
|
-
:
|
|
16
|
-
:
|
|
17
|
-
:
|
|
15
|
+
:param str client_id: The OAuth client id of the calling application.
|
|
16
|
+
:param str client_secret: Secret string that the application uses to prove its identity when requesting a token
|
|
17
|
+
:param str url: SharePoint web or site url
|
|
18
18
|
"""
|
|
19
19
|
self.url = url
|
|
20
20
|
self.redirect_url = None
|
|
@@ -37,6 +37,9 @@ class ACSTokenProvider(AuthenticationProvider, office365.logger.LoggerContext):
|
|
|
37
37
|
return self._cached_token and self._cached_token.is_valid
|
|
38
38
|
|
|
39
39
|
def get_app_only_access_token(self):
|
|
40
|
+
"""
|
|
41
|
+
Retrieves an app-only access token from ACS
|
|
42
|
+
"""
|
|
40
43
|
try:
|
|
41
44
|
realm = self._get_realm_from_target_url()
|
|
42
45
|
url_info = urlparse(self.url)
|
|
@@ -30,18 +30,22 @@ def xml_escape(s_val):
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
def is_valid_auth_cookies(values):
|
|
33
|
+
"""
|
|
34
|
+
Validates authorization cookies
|
|
35
|
+
"""
|
|
33
36
|
return any(values) and (values.get('FedAuth', None) is not None or values.get('SPOIDCRL', None) is not None)
|
|
34
37
|
|
|
35
38
|
|
|
36
39
|
class SamlTokenProvider(AuthenticationProvider, office365.logger.LoggerContext):
|
|
37
40
|
|
|
38
41
|
def __init__(self, url, username, password, browser_mode):
|
|
39
|
-
"""
|
|
42
|
+
"""
|
|
43
|
+
SAML Security Token Service provider (claims-based authentication)
|
|
40
44
|
|
|
41
|
-
:
|
|
42
|
-
:
|
|
43
|
-
:
|
|
44
|
-
:
|
|
45
|
+
:param str url: Site or Web absolute url
|
|
46
|
+
:param str username: Typically a UPN in the form of an email address
|
|
47
|
+
:param str password: The password
|
|
48
|
+
:param bool browser_mode:
|
|
45
49
|
"""
|
|
46
50
|
# Security Token Service info
|
|
47
51
|
self._sts_profile = STSProfile(resolve_base_url(url))
|
|
@@ -70,8 +74,7 @@ class SamlTokenProvider(AuthenticationProvider, office365.logger.LoggerContext):
|
|
|
70
74
|
|
|
71
75
|
def authenticate_request(self, request):
|
|
72
76
|
"""
|
|
73
|
-
|
|
74
|
-
:param request:
|
|
77
|
+
Authenticate request handler
|
|
75
78
|
"""
|
|
76
79
|
logger = self.logger(self.authenticate_request.__name__)
|
|
77
80
|
self.ensure_authentication_cookie()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
class TokenResponse(object):
|
|
2
2
|
|
|
3
|
-
def __init__(self,
|
|
4
|
-
self.accessToken =
|
|
5
|
-
self.tokenType =
|
|
3
|
+
def __init__(self, access_token=None, token_type=None, **kwargs):
|
|
4
|
+
self.accessToken = access_token
|
|
5
|
+
self.tokenType = token_type
|
|
6
6
|
for key, value in kwargs.items():
|
|
7
7
|
setattr(self, key, value)
|
|
8
8
|
|
|
@@ -206,8 +206,11 @@ class ClientObjectCollection(ClientObject):
|
|
|
206
206
|
self.context.load(self, before_loaded=_construct_next_query, after_loaded=after_loaded)
|
|
207
207
|
return self
|
|
208
208
|
|
|
209
|
-
def first(self):
|
|
210
|
-
"""Return the first Entity instance that matches current query
|
|
209
|
+
def first(self, expression):
|
|
210
|
+
"""Return the first Entity instance that matches current query
|
|
211
|
+
|
|
212
|
+
:param str expression: Filter expression
|
|
213
|
+
"""
|
|
211
214
|
return_type = self.create_typed_object()
|
|
212
215
|
self.add_child(return_type)
|
|
213
216
|
key = return_type.property_ref_name
|
|
@@ -221,13 +224,15 @@ class ClientObjectCollection(ClientObject):
|
|
|
221
224
|
raise ValueError(message)
|
|
222
225
|
return_type.set_property(key, col[0].get_property(key))
|
|
223
226
|
|
|
224
|
-
self.top(1)
|
|
227
|
+
self.filter(expression).top(1)
|
|
225
228
|
self.context.load(self, [key], after_loaded=_after_loaded)
|
|
226
229
|
return return_type
|
|
227
230
|
|
|
228
|
-
def single(self):
|
|
231
|
+
def single(self, expression):
|
|
229
232
|
"""
|
|
230
233
|
Return only one resulting Entity
|
|
234
|
+
|
|
235
|
+
:param str expression: Filter expression
|
|
231
236
|
"""
|
|
232
237
|
return_type = self.create_typed_object()
|
|
233
238
|
self.add_child(return_type)
|
|
@@ -238,14 +243,14 @@ class ClientObjectCollection(ClientObject):
|
|
|
238
243
|
:type col: ClientObjectCollection
|
|
239
244
|
"""
|
|
240
245
|
if len(col) == 0:
|
|
241
|
-
message = "Not found for filter: {0}".format(
|
|
246
|
+
message = "Not found for filter: {0}".format(expression)
|
|
242
247
|
raise ValueError(message)
|
|
243
248
|
elif len(col) > 1:
|
|
244
|
-
message = "Ambiguous match found for filter: {0}".format(
|
|
249
|
+
message = "Ambiguous match found for filter: {0}".format(expression)
|
|
245
250
|
raise ValueError(message)
|
|
246
251
|
return_type.set_property(key, col[0].get_property(key), False)
|
|
247
252
|
|
|
248
|
-
self.top(2)
|
|
253
|
+
self.filter(expression).top(2)
|
|
249
254
|
self.context.load(self, after_loaded=_after_loaded)
|
|
250
255
|
return return_type
|
|
251
256
|
|
|
@@ -19,9 +19,18 @@ class ClientResult(object):
|
|
|
19
19
|
self._context = context
|
|
20
20
|
self._value = copy.deepcopy(default_value)
|
|
21
21
|
|
|
22
|
+
def before_execute(self, action, *args, **kwargs):
|
|
23
|
+
"""
|
|
24
|
+
Attach an event handler which is triggered before query is submitted to server
|
|
25
|
+
:param (office365.runtime.http.request_options.RequestOptions) -> None action: Event handler
|
|
26
|
+
"""
|
|
27
|
+
self._context.before_query_execute(action, *args, **kwargs)
|
|
28
|
+
return self
|
|
29
|
+
|
|
22
30
|
def after_execute(self, action, *args, **kwargs):
|
|
23
31
|
"""
|
|
24
32
|
Attach an event handler which is triggered after query is submitted to server
|
|
33
|
+
:param (ClientResult) -> None action: Event handler
|
|
25
34
|
"""
|
|
26
35
|
self._context.after_query_execute(action, self, *args, **kwargs)
|
|
27
36
|
return self
|
|
@@ -92,28 +92,25 @@ class ClientRuntimeContext(object):
|
|
|
92
92
|
self.after_query_execute(after_loaded, client_object)
|
|
93
93
|
return self
|
|
94
94
|
|
|
95
|
-
def before_query_execute(self, action,
|
|
95
|
+
def before_query_execute(self, action, once=True, *args, **kwargs):
|
|
96
96
|
"""
|
|
97
97
|
Attach an event handler which is triggered before query is submitted to server
|
|
98
98
|
|
|
99
99
|
:type action: (office365.runtime.http.request_options.RequestOptions, *args, **kwargs) -> None
|
|
100
|
-
:
|
|
100
|
+
:param bool once: Flag which determines whether action is executed once or multiple times
|
|
101
101
|
"""
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
query = self._queries[-1]
|
|
103
|
+
query = self._queries[-1]
|
|
105
104
|
|
|
106
105
|
def _prepare_request(request):
|
|
107
106
|
"""
|
|
108
107
|
:type request: office365.runtime.http.request_options.RequestOptions
|
|
109
108
|
"""
|
|
110
|
-
if query.id == self.current_query.id:
|
|
111
|
-
print(query.url)
|
|
112
109
|
|
|
113
110
|
if self.current_query.id == query.id:
|
|
111
|
+
if once:
|
|
112
|
+
self.pending_request().beforeExecute -= _prepare_request
|
|
114
113
|
action(request, *args, **kwargs)
|
|
115
|
-
else:
|
|
116
|
-
self.pending_request().beforeExecute -= _prepare_request
|
|
117
114
|
|
|
118
115
|
self.pending_request().beforeExecute += _prepare_request
|
|
119
116
|
return self
|
|
@@ -152,6 +149,11 @@ class ClientRuntimeContext(object):
|
|
|
152
149
|
action(*args, **kwargs)
|
|
153
150
|
|
|
154
151
|
self.pending_request().afterExecute += _process_response
|
|
152
|
+
|
|
153
|
+
execute_first = kwargs.pop("execute_first", False)
|
|
154
|
+
if execute_first and len(self._queries) > 1:
|
|
155
|
+
self._queries.insert(0, self._queries.pop())
|
|
156
|
+
|
|
155
157
|
return self
|
|
156
158
|
|
|
157
159
|
def after_execute(self, action, once=True, *args, **kwargs):
|
|
@@ -27,7 +27,7 @@ class ODataRequest(ClientRequest):
|
|
|
27
27
|
self.beforeExecute += self._ensure_json_format
|
|
28
28
|
|
|
29
29
|
@property
|
|
30
|
-
def
|
|
30
|
+
def json_format(self):
|
|
31
31
|
return self._default_json_format
|
|
32
32
|
|
|
33
33
|
def build_request(self, query):
|
|
@@ -51,7 +51,7 @@ class ODataRequest(ClientRequest):
|
|
|
51
51
|
:type response: requests.Response
|
|
52
52
|
:type query: office365.runtime.queries.client_query.ClientQuery
|
|
53
53
|
"""
|
|
54
|
-
json_format = copy.deepcopy(self.
|
|
54
|
+
json_format = copy.deepcopy(self.json_format)
|
|
55
55
|
return_type = query.return_type
|
|
56
56
|
if return_type is None:
|
|
57
57
|
return
|
|
@@ -76,7 +76,7 @@ class ODataRequest(ClientRequest):
|
|
|
76
76
|
:type json_format: office365.runtime.odata.json_format.ODataJsonFormat
|
|
77
77
|
"""
|
|
78
78
|
if json_format is None:
|
|
79
|
-
json_format = self.
|
|
79
|
+
json_format = self.json_format
|
|
80
80
|
|
|
81
81
|
if json and return_type is not None:
|
|
82
82
|
for k, v in self._next_property(json, json_format):
|
|
@@ -143,6 +143,6 @@ class ODataRequest(ClientRequest):
|
|
|
143
143
|
"""
|
|
144
144
|
:type request: RequestOptions
|
|
145
145
|
"""
|
|
146
|
-
media_type = self.
|
|
146
|
+
media_type = self.json_format.media_type
|
|
147
147
|
request.ensure_header('Content-Type', media_type)
|
|
148
148
|
request.ensure_header('Accept', media_type)
|
office365/runtime/paths/appid.py
CHANGED
|
@@ -2,7 +2,8 @@ from office365.runtime.paths.resource_path import ResourcePath
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class AppIdPath(ResourcePath):
|
|
5
|
-
"""Path for addressing a Service Principal
|
|
5
|
+
"""Path for addressing a Service Principal or Application by appId where
|
|
6
|
+
appId is referred to as Application (client) ID on the Azure portal"""
|
|
6
7
|
|
|
7
8
|
@property
|
|
8
9
|
def segment(self):
|
|
@@ -19,9 +19,9 @@ class EntityPath(ResourcePath):
|
|
|
19
19
|
def segment(self):
|
|
20
20
|
return str(self.key or '<key>')
|
|
21
21
|
|
|
22
|
-
def
|
|
22
|
+
def patch(self, key, inplace=False):
|
|
23
23
|
"""
|
|
24
|
-
|
|
24
|
+
Patches path
|
|
25
25
|
|
|
26
26
|
:type key: str or None
|
|
27
27
|
:type inplace: bool
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
class
|
|
5
|
-
"""Path for addressing a single
|
|
4
|
+
class KeyPath(ResourcePath):
|
|
5
|
+
"""Path for addressing a single entity by key"""
|
|
6
6
|
|
|
7
7
|
@property
|
|
8
8
|
def segment(self):
|
|
9
|
-
if
|
|
9
|
+
if self.key is None:
|
|
10
|
+
return "(<key>)"
|
|
11
|
+
elif isinstance(self.key, int):
|
|
10
12
|
return "({0})".format(self.key)
|
|
11
13
|
return "('{0}')".format(self.key)
|
|
12
14
|
|
|
@@ -3,6 +3,12 @@ class EventHandler:
|
|
|
3
3
|
self._listeners = []
|
|
4
4
|
self._once = once
|
|
5
5
|
|
|
6
|
+
def __contains__(self, e):
|
|
7
|
+
return e in self._listeners
|
|
8
|
+
|
|
9
|
+
def __iter__(self):
|
|
10
|
+
return iter(self._listeners)
|
|
11
|
+
|
|
6
12
|
def __iadd__(self, listener):
|
|
7
13
|
self._listeners.append(listener)
|
|
8
14
|
return self
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from office365.entity import Entity
|
|
2
|
+
from office365.search.external.configuration import Configuration
|
|
3
|
+
from office365.search.external.search_settings import SearchSettings
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ExternalConnection(Entity):
|
|
7
|
+
"""A logical container to add content from an external source into Microsoft Graph."""
|
|
8
|
+
|
|
9
|
+
@property
|
|
10
|
+
def configuration(self):
|
|
11
|
+
"""
|
|
12
|
+
Specifies additional application IDs that are allowed to manage the connection and to index
|
|
13
|
+
content in the connection. Optional.
|
|
14
|
+
"""
|
|
15
|
+
return self.properties.get("configuration", Configuration())
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def search_settings(self):
|
|
19
|
+
"""
|
|
20
|
+
The settings configuring the search experience for content in this connection,
|
|
21
|
+
such as the display templates for search results.
|
|
22
|
+
"""
|
|
23
|
+
return self.properties.get("searchSettings", SearchSettings())
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def entity_type_name(self):
|
|
27
|
+
return "microsoft.graph.externalConnectors.externalConnection"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from office365.entity import Entity
|
|
2
2
|
from office365.entity_collection import EntityCollection
|
|
3
|
-
from office365.external.connection import ExternalConnection
|
|
3
|
+
from office365.search.external.connection import ExternalConnection
|
|
4
4
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
5
5
|
|
|
6
6
|
|
office365/search/query.py
CHANGED
|
@@ -3,11 +3,13 @@ from office365.runtime.client_value import ClientValue
|
|
|
3
3
|
|
|
4
4
|
class SearchQuery(ClientValue):
|
|
5
5
|
|
|
6
|
-
def __init__(self, query_string=None):
|
|
6
|
+
def __init__(self, query_string=None, query_template=None):
|
|
7
7
|
"""
|
|
8
8
|
Represents a search query that contains search terms and optional filters.
|
|
9
9
|
|
|
10
10
|
:param str query_string: The search query containing the search terms.
|
|
11
|
+
:param str query_template: Provides a way to decorate the query string. Supports both KQL and query variables.
|
|
11
12
|
"""
|
|
12
13
|
super(SearchQuery, self).__init__()
|
|
13
14
|
self.queryString = query_string
|
|
15
|
+
self.queryTemplate = query_template
|
office365/search/request.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from office365.runtime.client_value import ClientValue
|
|
2
2
|
from office365.runtime.client_value_collection import ClientValueCollection
|
|
3
3
|
from office365.runtime.types.collections import StringCollection
|
|
4
|
+
from office365.search.sharepoint_onedrive_options import SharePointOneDriveOptions
|
|
4
5
|
from office365.search.sort_property import SortProperty
|
|
5
6
|
|
|
6
7
|
|
|
@@ -8,7 +9,7 @@ class SearchRequest(ClientValue):
|
|
|
8
9
|
"""A search request formatted in a JSON blob."""
|
|
9
10
|
|
|
10
11
|
def __init__(self, query, entity_types=None, fields=None, search_from=None, sort_properties=None,
|
|
11
|
-
content_sources=None):
|
|
12
|
+
content_sources=None, sharepoint_onedrive_options=SharePointOneDriveOptions()):
|
|
12
13
|
"""
|
|
13
14
|
:param office365.search.query.SearchQuery query: Contains the query terms.
|
|
14
15
|
:param list[str] entity_types: One or more types of resources expected in the response.
|
|
@@ -33,4 +34,5 @@ class SearchRequest(ClientValue):
|
|
|
33
34
|
self.search_from = search_from
|
|
34
35
|
self.sortProperties = ClientValueCollection(SortProperty, sort_properties)
|
|
35
36
|
self.contentSources = StringCollection(content_sources)
|
|
37
|
+
self.sharePointOneDriveOptions = sharepoint_onedrive_options
|
|
36
38
|
|
|
@@ -3,3 +3,6 @@ from office365.runtime.client_value import ClientValue
|
|
|
3
3
|
|
|
4
4
|
class SharePointOneDriveOptions(ClientValue):
|
|
5
5
|
"""Provides the search content options when a search is performed using application permissions"""
|
|
6
|
+
|
|
7
|
+
def __init__(self, search_content=None):
|
|
8
|
+
self.searchContent = search_content
|
|
@@ -3,3 +3,12 @@ from office365.runtime.client_value import ClientValue
|
|
|
3
3
|
|
|
4
4
|
class SortProperty(ClientValue):
|
|
5
5
|
"""Indicates the order to sort search results."""
|
|
6
|
+
|
|
7
|
+
def __init__(self, is_descending=None, name=None):
|
|
8
|
+
"""
|
|
9
|
+
:param bool is_descending: True if the sort order is descending. Default is false,
|
|
10
|
+
with the sort order as ascending. Optional.
|
|
11
|
+
:param str name: The name of the property to sort on. Required.
|
|
12
|
+
"""
|
|
13
|
+
self.isDescending = is_descending
|
|
14
|
+
self.name = name
|