Skip to content

Include resource data added to Subscription.add #901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions office365/subscriptions/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def add(
expiration,
client_state=None,
latest_supported_tls_version=None,
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
Expand All @@ -34,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)
Expand All @@ -44,6 +57,9 @@ def add(
"expirationDateTime": expiration.isoformat() + "Z",
"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)
Expand Down