From 6103ed8917c75a64ef4d12448d411dc4a2740d97 Mon Sep 17 00:00:00 2001 From: optimygmbh Date: Thu, 10 Oct 2024 13:55:08 +0200 Subject: [PATCH 1/2] include_resource_data added to SubscriptionCollection.add --- office365/subscriptions/collection.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/office365/subscriptions/collection.py b/office365/subscriptions/collection.py index 1a961c58..75d9589e 100644 --- a/office365/subscriptions/collection.py +++ b/office365/subscriptions/collection.py @@ -17,6 +17,7 @@ def add( expiration, client_state=None, latest_supported_tls_version=None, + include_resource_data=False, ): """ Subscribes a listener application to receive change notifications when the requested type of changes occur @@ -44,6 +45,7 @@ def add( "expirationDateTime": expiration.isoformat() + "Z", "clientState": client_state, "latestSupportedTlsVersion": latest_supported_tls_version, + "includeResourceData": include_resource_data, } qry = CreateEntityQuery(self, payload, return_type) self.context.add_query(qry) From cafac72fdbe800d235236e31ec74d47584745ca2 Mon Sep 17 00:00:00 2001 From: optimygmbh Date: Thu, 10 Oct 2024 16:05:26 +0200 Subject: [PATCH 2/2] encryption certificate added --- office365/subscriptions/collection.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/office365/subscriptions/collection.py b/office365/subscriptions/collection.py index 75d9589e..20262a0e 100644 --- a/office365/subscriptions/collection.py +++ b/office365/subscriptions/collection.py @@ -17,7 +17,9 @@ def add( expiration, client_state=None, latest_supported_tls_version=None, - include_resource_data=False, + include_resource_data=None, + encryption_certificate=None, + encryption_certificate_id=None, ): """ Subscribes a listener application to receive change notifications when the requested type of changes occur @@ -35,6 +37,16 @@ def add( :param str latest_supported_tls_version: Specifies the latest version of Transport Layer Security (TLS) that the notification endpoint, specified by notificationUrl, supports. The possible values are: v1_0, v1_1, v1_2, v1_3. + :param bool include_resource_data: Indicates whether the resource data for the resource that generated the + change notification should be included in the payload of the notification. + :param str encryption_certificate: Specifies the public key certificate which contains only the public key + that Microsoft Graph uses to encrypt the resource data it returns to your app. For security, Microsoft + Graph encrypts the resource data returned in a rich notification. You must provide a public encryption + key as part of creating the subscription. + :param str encryption_certificate_id: Specifies the identifier of the certificate used to encrypt the content + of the change notification. Use this ID to match in each change notification, which certificate to use + for decryption. + :return: Subscription """ return_type = Subscription(self.context) self.add_child(return_type) @@ -46,6 +58,8 @@ def add( "clientState": client_state, "latestSupportedTlsVersion": latest_supported_tls_version, "includeResourceData": include_resource_data, + "encryptionCertificate": encryption_certificate, + "encryptionCertificateId": encryption_certificate_id, } qry = CreateEntityQuery(self, payload, return_type) self.context.add_query(qry)