MicrosoftGraphSubscription Class

public final class MicrosoftGraphSubscription
extends MicrosoftGraphEntity

subscription.

Constructor Summary

Constructor Description
MicrosoftGraphSubscription()

Creates an instance of MicrosoftGraphSubscription class.

Method Summary

Modifier and Type Method and Description
Map<String,Object> additionalProperties()

Get the additionalProperties property: subscription.

String applicationId()

Get the applicationId property: Identifier of the application used to create the subscription.

String changeType()

Get the changeType property: Required.

String clientState()

Get the clientState property: Optional.

String creatorId()

Get the creatorId property: Identifier of the user or service principal that created the subscription.

String encryptionCertificate()

Get the encryptionCertificate property: A base64-encoded representation of a certificate with a public key used to encrypt resource data in change notifications.

String encryptionCertificateId()

Get the encryptionCertificateId property: A custom app-provided identifier to help identify the certificate needed to decrypt resource data.

OffsetDateTime expirationDateTime()

Get the expirationDateTime property: Required.

static MicrosoftGraphSubscription fromJson(JsonReader jsonReader)

Reads an instance of MicrosoftGraphSubscription from the JsonReader.

Boolean includeResourceData()

Get the includeResourceData property: When set to true, change notifications include resource data (such as content of a chat message).

String latestSupportedTlsVersion()

Get the latestSupportedTlsVersion property: Specifies the latest version of Transport Layer Security (TLS) that the notification endpoint, specified by notificationUrl, supports.

String lifecycleNotificationUrl()

Get the lifecycleNotificationUrl property: The URL of the endpoint that receives lifecycle notifications, including subscriptionRemoved and missed notifications.

String notificationUrl()

Get the notificationUrl property: Required.

String resource()

Get the resource property: Required.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

MicrosoftGraphSubscription withAdditionalProperties(Map<String,Object> additionalProperties)

Set the additionalProperties property: subscription.

MicrosoftGraphSubscription withApplicationId(String applicationId)

Set the applicationId property: Identifier of the application used to create the subscription.

MicrosoftGraphSubscription withChangeType(String changeType)

Set the changeType property: Required.

MicrosoftGraphSubscription withClientState(String clientState)

Set the clientState property: Optional.

MicrosoftGraphSubscription withCreatorId(String creatorId)

Set the creatorId property: Identifier of the user or service principal that created the subscription.

MicrosoftGraphSubscription withEncryptionCertificate(String encryptionCertificate)

Set the encryptionCertificate property: A base64-encoded representation of a certificate with a public key used to encrypt resource data in change notifications.

MicrosoftGraphSubscription withEncryptionCertificateId(String encryptionCertificateId)

Set the encryptionCertificateId property: A custom app-provided identifier to help identify the certificate needed to decrypt resource data.

MicrosoftGraphSubscription withExpirationDateTime(OffsetDateTime expirationDateTime)

Set the expirationDateTime property: Required.

MicrosoftGraphSubscription withId(String id)

Set the id property: Read-only.

MicrosoftGraphSubscription withIncludeResourceData(Boolean includeResourceData)

Set the includeResourceData property: When set to true, change notifications include resource data (such as content of a chat message).

MicrosoftGraphSubscription withLatestSupportedTlsVersion(String latestSupportedTlsVersion)

Set the latestSupportedTlsVersion property: Specifies the latest version of Transport Layer Security (TLS) that the notification endpoint, specified by notificationUrl, supports.

MicrosoftGraphSubscription withLifecycleNotificationUrl(String lifecycleNotificationUrl)

Set the lifecycleNotificationUrl property: The URL of the endpoint that receives lifecycle notifications, including subscriptionRemoved and missed notifications.

MicrosoftGraphSubscription withNotificationUrl(String notificationUrl)

Set the notificationUrl property: Required.

MicrosoftGraphSubscription withResource(String resource)

Set the resource property: Required.

Methods inherited from MicrosoftGraphEntity

Methods inherited from java.lang.Object

Constructor Details

MicrosoftGraphSubscription

public MicrosoftGraphSubscription()

Creates an instance of MicrosoftGraphSubscription class.

Method Details

additionalProperties

public Map additionalProperties()

Get the additionalProperties property: subscription.

Overrides:

MicrosoftGraphSubscription.additionalProperties()

Returns:

the additionalProperties value.

applicationId

public String applicationId()

Get the applicationId property: Identifier of the application used to create the subscription. Read-only.

Returns:

the applicationId value.

changeType

public String changeType()

Get the changeType property: Required. Indicates the type of change in the subscribed resource that will raise a change notification. The supported values are: created, updated, deleted. Multiple values can be combined using a comma-separated list.Note: Drive root item and list change notifications support only the updated changeType. User and group change notifications support updated and deleted changeType.

Returns:

the changeType value.

clientState

public String clientState()

Get the clientState property: Optional. Specifies the value of the clientState property sent by the service in each change notification. The maximum length is 128 characters. The client can check that the change notification came from the service by comparing the value of the clientState property sent with the subscription with the value of the clientState property received with each change notification.

Returns:

the clientState value.

creatorId

public String creatorId()

Get the creatorId property: Identifier of the user or service principal that created the subscription. If the app used delegated permissions to create the subscription, this field contains the id of the signed-in user the app called on behalf of. If the app used application permissions, this field contains the id of the service principal corresponding to the app. Read-only.

Returns:

the creatorId value.

encryptionCertificate

public String encryptionCertificate()

Get the encryptionCertificate property: A base64-encoded representation of a certificate with a public key used to encrypt resource data in change notifications. Optional. Required when includeResourceData is true.

Returns:

the encryptionCertificate value.

encryptionCertificateId

public String encryptionCertificateId()

Get the encryptionCertificateId property: A custom app-provided identifier to help identify the certificate needed to decrypt resource data. Optional.

Returns:

the encryptionCertificateId value.

expirationDateTime

public OffsetDateTime expirationDateTime()

Get the expirationDateTime property: Required. Specifies the date and time when the webhook subscription expires. The time is in UTC, and can be an amount of time from subscription creation that varies for the resource subscribed to. See the table below for maximum supported subscription length of time.

Returns:

the expirationDateTime value.

fromJson

public static MicrosoftGraphSubscription fromJson(JsonReader jsonReader)

Reads an instance of MicrosoftGraphSubscription from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MicrosoftGraphSubscription if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the MicrosoftGraphSubscription.

includeResourceData

public Boolean includeResourceData()

Get the includeResourceData property: When set to true, change notifications include resource data (such as content of a chat message). Optional.

Returns:

the includeResourceData value.

latestSupportedTlsVersion

public String latestSupportedTlsVersion()

Get the latestSupportedTlsVersion property: 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. For subscribers whose notification endpoint supports a version lower than the currently recommended version (TLS 1.2), specifying this property by a set timeline allows them to temporarily use their deprecated version of TLS before completing their upgrade to TLS 1.2. For these subscribers, not setting this property per the timeline would result in subscription operations failing. For subscribers whose notification endpoint already supports TLS 1.2, setting this property is optional. In such cases, Microsoft Graph defaults the property to v1_2.

Returns:

the latestSupportedTlsVersion value.

lifecycleNotificationUrl

public String lifecycleNotificationUrl()

Get the lifecycleNotificationUrl property: The URL of the endpoint that receives lifecycle notifications, including subscriptionRemoved and missed notifications. This URL must make use of the HTTPS protocol. Optional. Read more about how Outlook resources use lifecycle notifications.

Returns:

the lifecycleNotificationUrl value.

notificationUrl

public String notificationUrl()

Get the notificationUrl property: Required. The URL of the endpoint that will receive the change notifications. This URL must make use of the HTTPS protocol.

Returns:

the notificationUrl value.

resource

public String resource()

Get the resource property: Required. Specifies the resource that will be monitored for changes. Do not include the base URL (https://graph.microsoft.com/v1.0/). See the possible resource path values for each supported resource.

Returns:

the resource value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

MicrosoftGraphSubscription.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

Overrides:

MicrosoftGraphSubscription.validate()

withAdditionalProperties

public MicrosoftGraphSubscription withAdditionalProperties(Map additionalProperties)

Set the additionalProperties property: subscription.

Overrides:

MicrosoftGraphSubscription.withAdditionalProperties(Map<String,Object> additionalProperties)

Parameters:

additionalProperties - the additionalProperties value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withApplicationId

public MicrosoftGraphSubscription withApplicationId(String applicationId)

Set the applicationId property: Identifier of the application used to create the subscription. Read-only.

Parameters:

applicationId - the applicationId value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withChangeType

public MicrosoftGraphSubscription withChangeType(String changeType)

Set the changeType property: Required. Indicates the type of change in the subscribed resource that will raise a change notification. The supported values are: created, updated, deleted. Multiple values can be combined using a comma-separated list.Note: Drive root item and list change notifications support only the updated changeType. User and group change notifications support updated and deleted changeType.

Parameters:

changeType - the changeType value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withClientState

public MicrosoftGraphSubscription withClientState(String clientState)

Set the clientState property: Optional. Specifies the value of the clientState property sent by the service in each change notification. The maximum length is 128 characters. The client can check that the change notification came from the service by comparing the value of the clientState property sent with the subscription with the value of the clientState property received with each change notification.

Parameters:

clientState - the clientState value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withCreatorId

public MicrosoftGraphSubscription withCreatorId(String creatorId)

Set the creatorId property: Identifier of the user or service principal that created the subscription. If the app used delegated permissions to create the subscription, this field contains the id of the signed-in user the app called on behalf of. If the app used application permissions, this field contains the id of the service principal corresponding to the app. Read-only.

Parameters:

creatorId - the creatorId value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withEncryptionCertificate

public MicrosoftGraphSubscription withEncryptionCertificate(String encryptionCertificate)

Set the encryptionCertificate property: A base64-encoded representation of a certificate with a public key used to encrypt resource data in change notifications. Optional. Required when includeResourceData is true.

Parameters:

encryptionCertificate - the encryptionCertificate value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withEncryptionCertificateId

public MicrosoftGraphSubscription withEncryptionCertificateId(String encryptionCertificateId)

Set the encryptionCertificateId property: A custom app-provided identifier to help identify the certificate needed to decrypt resource data. Optional.

Parameters:

encryptionCertificateId - the encryptionCertificateId value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withExpirationDateTime

public MicrosoftGraphSubscription withExpirationDateTime(OffsetDateTime expirationDateTime)

Set the expirationDateTime property: Required. Specifies the date and time when the webhook subscription expires. The time is in UTC, and can be an amount of time from subscription creation that varies for the resource subscribed to. See the table below for maximum supported subscription length of time.

Parameters:

expirationDateTime - the expirationDateTime value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withId

public MicrosoftGraphSubscription withId(String id)

Set the id property: Read-only.

Overrides:

MicrosoftGraphSubscription.withId(String id)

Parameters:

id

withIncludeResourceData

public MicrosoftGraphSubscription withIncludeResourceData(Boolean includeResourceData)

Set the includeResourceData property: When set to true, change notifications include resource data (such as content of a chat message). Optional.

Parameters:

includeResourceData - the includeResourceData value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withLatestSupportedTlsVersion

public MicrosoftGraphSubscription withLatestSupportedTlsVersion(String latestSupportedTlsVersion)

Set the latestSupportedTlsVersion property: 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. For subscribers whose notification endpoint supports a version lower than the currently recommended version (TLS 1.2), specifying this property by a set timeline allows them to temporarily use their deprecated version of TLS before completing their upgrade to TLS 1.2. For these subscribers, not setting this property per the timeline would result in subscription operations failing. For subscribers whose notification endpoint already supports TLS 1.2, setting this property is optional. In such cases, Microsoft Graph defaults the property to v1_2.

Parameters:

latestSupportedTlsVersion - the latestSupportedTlsVersion value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withLifecycleNotificationUrl

public MicrosoftGraphSubscription withLifecycleNotificationUrl(String lifecycleNotificationUrl)

Set the lifecycleNotificationUrl property: The URL of the endpoint that receives lifecycle notifications, including subscriptionRemoved and missed notifications. This URL must make use of the HTTPS protocol. Optional. Read more about how Outlook resources use lifecycle notifications.

Parameters:

lifecycleNotificationUrl - the lifecycleNotificationUrl value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withNotificationUrl

public MicrosoftGraphSubscription withNotificationUrl(String notificationUrl)

Set the notificationUrl property: Required. The URL of the endpoint that will receive the change notifications. This URL must make use of the HTTPS protocol.

Parameters:

notificationUrl - the notificationUrl value to set.

Returns:

the MicrosoftGraphSubscription object itself.

withResource

public MicrosoftGraphSubscription withResource(String resource)

Set the resource property: Required. Specifies the resource that will be monitored for changes. Do not include the base URL (https://graph.microsoft.com/v1.0/). See the possible resource path values for each supported resource.

Parameters:

resource - the resource value to set.

Returns:

the MicrosoftGraphSubscription object itself.

Applies to