Class Subscription

java.lang.Object
com.microsoft.graph.models.Entity
com.microsoft.graph.models.Subscription
All Implemented Interfaces:
com.microsoft.kiota.serialization.AdditionalDataHolder, com.microsoft.kiota.serialization.Parsable, com.microsoft.kiota.store.BackedModel

@Generated("com.microsoft.kiota") public class Subscription extends Entity implements com.microsoft.kiota.serialization.Parsable
  • Constructor Details

    • Subscription

      public Subscription()
      Instantiates a new Subscription and sets the default values.
  • Method Details

    • createFromDiscriminatorValue

      @Nonnull public static Subscription createFromDiscriminatorValue(@Nonnull com.microsoft.kiota.serialization.ParseNode parseNode)
      Creates a new instance of the appropriate class based on discriminator value
      Parameters:
      parseNode - The parse node to use to read the discriminator value and create the object
      Returns:
      a Subscription
    • getApplicationId

      @Nullable public String getApplicationId()
      Gets the applicationId property value. Optional. Identifier of the application used to create the subscription. Read-only.
      Returns:
      a String
    • getChangeType

      @Nullable public String getChangeType()
      Gets the changeType property value. Required. Indicates the type of change in the subscribed resource that raises 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. Use updated to receive notifications when user or group is created, updated, or soft deleted. Use deleted to receive notifications when user or group is permanently deleted.
      Returns:
      a String
    • getClientState

      @Nullable public String getClientState()
      Gets the clientState property value. 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:
      a String
    • getCreatorId

      @Nullable public String getCreatorId()
      Gets the creatorId property value. Optional. 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:
      a String
    • getEncryptionCertificate

      @Nullable public String getEncryptionCertificate()
      Gets the encryptionCertificate property value. Optional. A base64-encoded representation of a certificate with a public key used to encrypt resource data in change notifications. Optional but required when includeResourceData is true.
      Returns:
      a String
    • getEncryptionCertificateId

      @Nullable public String getEncryptionCertificateId()
      Gets the encryptionCertificateId property value. Optional. A custom app-provided identifier to help identify the certificate needed to decrypt resource data.
      Returns:
      a String
    • getExpirationDateTime

      @Nullable public OffsetDateTime getExpirationDateTime()
      Gets the expirationDateTime property value. 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. For the maximum supported subscription length of time, see Subscription lifetime.
      Returns:
      a OffsetDateTime
    • getFieldDeserializers

      @Nonnull public Map<String,Consumer<com.microsoft.kiota.serialization.ParseNode>> getFieldDeserializers()
      The deserialization information for the current model
      Specified by:
      getFieldDeserializers in interface com.microsoft.kiota.serialization.Parsable
      Overrides:
      getFieldDeserializers in class Entity
      Returns:
      a Map<String,Consumer<com.microsoft.kiota.serialization.ParseNode>>
    • getIncludeResourceData

      @Nullable public Boolean getIncludeResourceData()
      Gets the includeResourceData property value. Optional. When set to true, change notifications include resource data (such as content of a chat message).
      Returns:
      a Boolean
    • getLatestSupportedTlsVersion

      @Nullable public String getLatestSupportedTlsVersion()
      Gets the latestSupportedTlsVersion property value. Optional. Specifies the latest version of Transport Layer Security (TLS) that the notification endpoint, specified by notificationUrl, supports. The possible values are: v10, v11, v12, v13. 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:
      a String
    • getLifecycleNotificationUrl

      @Nullable public String getLifecycleNotificationUrl()
      Gets the lifecycleNotificationUrl property value. Required for Teams resources if the expirationDateTime value is more than 1 hour from now; optional otherwise. The URL of the endpoint that receives lifecycle notifications, including subscriptionRemoved, reauthorizationRequired, and missed notifications. This URL must make use of the HTTPS protocol. For more information, see Reduce missing subscriptions and change notifications.
      Returns:
      a String
    • getNotificationQueryOptions

      @Nullable public String getNotificationQueryOptions()
      Gets the notificationQueryOptions property value. Optional. OData query options for specifying value for the targeting resource. Clients receive notifications when resource reaches the state matching the query options provided here. With this new property in the subscription creation payload along with all existing properties, Webhooks deliver notifications whenever a resource reaches the desired state mentioned in the notificationQueryOptions property. For example, when the print job is completed or when a print job resource isFetchable property value becomes true etc. Supported only for Universal Print Service. For more information, see Subscribe to change notifications from cloud printing APIs using Microsoft Graph.
      Returns:
      a String
    • getNotificationUrl

      @Nullable public String getNotificationUrl()
      Gets the notificationUrl property value. Required. The URL of the endpoint that receives the change notifications. This URL must make use of the HTTPS protocol. Any query string parameter included in the notificationUrl property is included in the HTTP POST request when Microsoft Graph sends the change notifications.
      Returns:
      a String
    • getNotificationUrlAppId

      @Nullable public String getNotificationUrlAppId()
      Gets the notificationUrlAppId property value. Optional. The app ID that the subscription service can use to generate the validation token. The value allows the client to validate the authenticity of the notification received.
      Returns:
      a String
    • getResource

      @Nullable public String getResource()
      Gets the resource property value. Required. Specifies the resource that is monitored for changes. Don't include the base URL (https://graph.microsoft.com/v1.0/). See the possible resource path values for each supported resource.
      Returns:
      a String
    • serialize

      public void serialize(@Nonnull com.microsoft.kiota.serialization.SerializationWriter writer)
      Serializes information the current object
      Specified by:
      serialize in interface com.microsoft.kiota.serialization.Parsable
      Overrides:
      serialize in class Entity
      Parameters:
      writer - Serialization writer to use to serialize this model
    • setApplicationId

      public void setApplicationId(@Nullable String value)
      Sets the applicationId property value. Optional. Identifier of the application used to create the subscription. Read-only.
      Parameters:
      value - Value to set for the applicationId property.
    • setChangeType

      public void setChangeType(@Nullable String value)
      Sets the changeType property value. Required. Indicates the type of change in the subscribed resource that raises 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. Use updated to receive notifications when user or group is created, updated, or soft deleted. Use deleted to receive notifications when user or group is permanently deleted.
      Parameters:
      value - Value to set for the changeType property.
    • setClientState

      public void setClientState(@Nullable String value)
      Sets the clientState property value. 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:
      value - Value to set for the clientState property.
    • setCreatorId

      public void setCreatorId(@Nullable String value)
      Sets the creatorId property value. Optional. 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:
      value - Value to set for the creatorId property.
    • setEncryptionCertificate

      public void setEncryptionCertificate(@Nullable String value)
      Sets the encryptionCertificate property value. Optional. A base64-encoded representation of a certificate with a public key used to encrypt resource data in change notifications. Optional but required when includeResourceData is true.
      Parameters:
      value - Value to set for the encryptionCertificate property.
    • setEncryptionCertificateId

      public void setEncryptionCertificateId(@Nullable String value)
      Sets the encryptionCertificateId property value. Optional. A custom app-provided identifier to help identify the certificate needed to decrypt resource data.
      Parameters:
      value - Value to set for the encryptionCertificateId property.
    • setExpirationDateTime

      public void setExpirationDateTime(@Nullable OffsetDateTime value)
      Sets the expirationDateTime property value. 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. For the maximum supported subscription length of time, see Subscription lifetime.
      Parameters:
      value - Value to set for the expirationDateTime property.
    • setIncludeResourceData

      public void setIncludeResourceData(@Nullable Boolean value)
      Sets the includeResourceData property value. Optional. When set to true, change notifications include resource data (such as content of a chat message).
      Parameters:
      value - Value to set for the includeResourceData property.
    • setLatestSupportedTlsVersion

      public void setLatestSupportedTlsVersion(@Nullable String value)
      Sets the latestSupportedTlsVersion property value. Optional. Specifies the latest version of Transport Layer Security (TLS) that the notification endpoint, specified by notificationUrl, supports. The possible values are: v10, v11, v12, v13. 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:
      value - Value to set for the latestSupportedTlsVersion property.
    • setLifecycleNotificationUrl

      public void setLifecycleNotificationUrl(@Nullable String value)
      Sets the lifecycleNotificationUrl property value. Required for Teams resources if the expirationDateTime value is more than 1 hour from now; optional otherwise. The URL of the endpoint that receives lifecycle notifications, including subscriptionRemoved, reauthorizationRequired, and missed notifications. This URL must make use of the HTTPS protocol. For more information, see Reduce missing subscriptions and change notifications.
      Parameters:
      value - Value to set for the lifecycleNotificationUrl property.
    • setNotificationQueryOptions

      public void setNotificationQueryOptions(@Nullable String value)
      Sets the notificationQueryOptions property value. Optional. OData query options for specifying value for the targeting resource. Clients receive notifications when resource reaches the state matching the query options provided here. With this new property in the subscription creation payload along with all existing properties, Webhooks deliver notifications whenever a resource reaches the desired state mentioned in the notificationQueryOptions property. For example, when the print job is completed or when a print job resource isFetchable property value becomes true etc. Supported only for Universal Print Service. For more information, see Subscribe to change notifications from cloud printing APIs using Microsoft Graph.
      Parameters:
      value - Value to set for the notificationQueryOptions property.
    • setNotificationUrl

      public void setNotificationUrl(@Nullable String value)
      Sets the notificationUrl property value. Required. The URL of the endpoint that receives the change notifications. This URL must make use of the HTTPS protocol. Any query string parameter included in the notificationUrl property is included in the HTTP POST request when Microsoft Graph sends the change notifications.
      Parameters:
      value - Value to set for the notificationUrl property.
    • setNotificationUrlAppId

      public void setNotificationUrlAppId(@Nullable String value)
      Sets the notificationUrlAppId property value. Optional. The app ID that the subscription service can use to generate the validation token. The value allows the client to validate the authenticity of the notification received.
      Parameters:
      value - Value to set for the notificationUrlAppId property.
    • setResource

      public void setResource(@Nullable String value)
      Sets the resource property value. Required. Specifies the resource that is monitored for changes. Don't include the base URL (https://graph.microsoft.com/v1.0/). See the possible resource path values for each supported resource.
      Parameters:
      value - Value to set for the resource property.