Skip to content

Commit

Permalink
Merge pull request #901 from optimygmbh/master
Browse files Browse the repository at this point in the history
Include resource data added to Subscription.add
  • Loading branch information
vgrem authored Oct 10, 2024
2 parents 8bad836 + cafac72 commit c6820cb
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit c6820cb

Please sign in to comment.