Class: MicrosoftGraph::Models::Subscription

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/subscription.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#additional_data, #additional_data=, #id, #id=, #odata_type, #odata_type=

Constructor Details

#initializeObject

Instantiates a new subscription and sets the default values.



101
102
103
# File 'lib/models/subscription.rb', line 101

def initialize()
    super
end

Class Method Details

.create_from_discriminator_value(parse_node) ⇒ Object

Creates a new instance of the appropriate class based on discriminator value

Parameters:

  • parse_node

    The parse node to use to read the discriminator value and create the object

Returns:

  • a subscription

Raises:

  • (StandardError)


109
110
111
112
# File 'lib/models/subscription.rb', line 109

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return Subscription.new
end

Instance Method Details

#application_idObject

Gets the applicationId property value. Optional. Identifier of the application used to create the subscription. Read-only.

Returns:

  • a string



56
57
58
# File 'lib/models/subscription.rb', line 56

def application_id
    return @application_id
end

#application_id=(value) ⇒ Object

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.

Returns:

  • a void



64
65
66
# File 'lib/models/subscription.rb', line 64

def application_id=(value)
    @application_id = value
end

#change_typeObject

Gets the changeType property value. 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. 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



71
72
73
# File 'lib/models/subscription.rb', line 71

def change_type
    return @change_type
end

#change_type=(value) ⇒ Object

Sets the changeType property value. 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. 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.

Returns:

  • a void



79
80
81
# File 'lib/models/subscription.rb', line 79

def change_type=(value)
    @change_type = value
end

#client_stateObject

Gets the clientState property value. Required. 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



86
87
88
# File 'lib/models/subscription.rb', line 86

def client_state
    return @client_state
end

#client_state=(value) ⇒ Object

Sets the clientState property value. Required. 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.

Returns:

  • a void



94
95
96
# File 'lib/models/subscription.rb', line 94

def client_state=(value)
    @client_state = value
end

#creator_idObject

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



117
118
119
# File 'lib/models/subscription.rb', line 117

def creator_id
    return @creator_id
end

#creator_id=(value) ⇒ Object

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.

Returns:

  • a void



125
126
127
# File 'lib/models/subscription.rb', line 125

def creator_id=(value)
    @creator_id = value
end

#encryption_certificateObject

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



132
133
134
# File 'lib/models/subscription.rb', line 132

def encryption_certificate
    return @encryption_certificate
end

#encryption_certificate=(value) ⇒ Object

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.

Returns:

  • a void



140
141
142
# File 'lib/models/subscription.rb', line 140

def encryption_certificate=(value)
    @encryption_certificate = value
end

#encryption_certificate_idObject

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

Returns:

  • a string



147
148
149
# File 'lib/models/subscription.rb', line 147

def encryption_certificate_id
    return @encryption_certificate_id
end

#encryption_certificate_id=(value) ⇒ Object

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.

Returns:

  • a void



155
156
157
# File 'lib/models/subscription.rb', line 155

def encryption_certificate_id=(value)
    @encryption_certificate_id = value
end

#expiration_date_timeObject

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 the table below.

Returns:

  • a date_time



162
163
164
# File 'lib/models/subscription.rb', line 162

def expiration_date_time
    return @expiration_date_time
end

#expiration_date_time=(value) ⇒ Object

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 the table below.

Parameters:

  • value

    Value to set for the expirationDateTime property.

Returns:

  • a void



170
171
172
# File 'lib/models/subscription.rb', line 170

def expiration_date_time=(value)
    @expiration_date_time = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/models/subscription.rb', line 177

def get_field_deserializers()
    return super.merge({
        "applicationId" => lambda {|n| @application_id = n.get_string_value() },
        "changeType" => lambda {|n| @change_type = n.get_string_value() },
        "clientState" => lambda {|n| @client_state = n.get_string_value() },
        "creatorId" => lambda {|n| @creator_id = n.get_string_value() },
        "encryptionCertificate" => lambda {|n| @encryption_certificate = n.get_string_value() },
        "encryptionCertificateId" => lambda {|n| @encryption_certificate_id = n.get_string_value() },
        "expirationDateTime" => lambda {|n| @expiration_date_time = n.get_date_time_value() },
        "includeResourceData" => lambda {|n| @include_resource_data = n.get_boolean_value() },
        "latestSupportedTlsVersion" => lambda {|n| @latest_supported_tls_version = n.get_string_value() },
        "lifecycleNotificationUrl" => lambda {|n| @lifecycle_notification_url = n.get_string_value() },
        "notificationQueryOptions" => lambda {|n| @notification_query_options = n.get_string_value() },
        "notificationUrl" => lambda {|n| @notification_url = n.get_string_value() },
        "notificationUrlAppId" => lambda {|n| @notification_url_app_id = n.get_string_value() },
        "resource" => lambda {|n| @resource = n.get_string_value() },
    })
end

#include_resource_dataObject

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



199
200
201
# File 'lib/models/subscription.rb', line 199

def include_resource_data
    return @include_resource_data
end

#include_resource_data=(value) ⇒ Object

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.

Returns:

  • a void



207
208
209
# File 'lib/models/subscription.rb', line 207

def include_resource_data=(value)
    @include_resource_data = value
end

#latest_supported_tls_versionObject

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



214
215
216
# File 'lib/models/subscription.rb', line 214

def latest_supported_tls_version
    return @latest_supported_tls_version
end

#latest_supported_tls_version=(value) ⇒ Object

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.

Returns:

  • a void



222
223
224
# File 'lib/models/subscription.rb', line 222

def latest_supported_tls_version=(value)
    @latest_supported_tls_version = value
end

#lifecycle_notification_urlObject

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



229
230
231
# File 'lib/models/subscription.rb', line 229

def lifecycle_notification_url
    return @lifecycle_notification_url
end

#lifecycle_notification_url=(value) ⇒ Object

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.

Returns:

  • a void



237
238
239
# File 'lib/models/subscription.rb', line 237

def lifecycle_notification_url=(value)
    @lifecycle_notification_url = value
end

#notification_query_optionsObject

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 will 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



244
245
246
# File 'lib/models/subscription.rb', line 244

def notification_query_options
    return @notification_query_options
end

#notification_query_options=(value) ⇒ Object

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 will 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.

Returns:

  • a void



252
253
254
# File 'lib/models/subscription.rb', line 252

def notification_query_options=(value)
    @notification_query_options = value
end

#notification_urlObject

Gets the notificationUrl property value. Required. The URL of the endpoint that will receive the change notifications. This URL must make use of the HTTPS protocol. Any query string parameter included in the notificationUrl property will be included in the HTTP POST request when Microsoft Graph sends the change notifications.

Returns:

  • a string



259
260
261
# File 'lib/models/subscription.rb', line 259

def notification_url
    return @notification_url
end

#notification_url=(value) ⇒ Object

Sets the notificationUrl property value. Required. The URL of the endpoint that will receive the change notifications. This URL must make use of the HTTPS protocol. Any query string parameter included in the notificationUrl property will be included in the HTTP POST request when Microsoft Graph sends the change notifications.

Parameters:

  • value

    Value to set for the notificationUrl property.

Returns:

  • a void



267
268
269
# File 'lib/models/subscription.rb', line 267

def notification_url=(value)
    @notification_url = value
end

#notification_url_app_idObject

Gets the notificationUrlAppId property value. Optional. The app ID that the subscription service can use to generate the validation token. This allows the client to validate the authenticity of the notification received.

Returns:

  • a string



274
275
276
# File 'lib/models/subscription.rb', line 274

def notification_url_app_id
    return @notification_url_app_id
end

#notification_url_app_id=(value) ⇒ Object

Sets the notificationUrlAppId property value. Optional. The app ID that the subscription service can use to generate the validation token. This allows the client to validate the authenticity of the notification received.

Parameters:

  • value

    Value to set for the notificationUrlAppId property.

Returns:

  • a void



282
283
284
# File 'lib/models/subscription.rb', line 282

def notification_url_app_id=(value)
    @notification_url_app_id = value
end

#resourceObject

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

Returns:

  • a string



289
290
291
# File 'lib/models/subscription.rb', line 289

def resource
    return @resource
end

#resource=(value) ⇒ Object

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

Parameters:

  • value

    Value to set for the resource property.

Returns:

  • a void



297
298
299
# File 'lib/models/subscription.rb', line 297

def resource=(value)
    @resource = value
end

#serialize(writer) ⇒ Object

Serializes information the current object

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/models/subscription.rb', line 305

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_string_value("applicationId", @application_id)
    writer.write_string_value("changeType", @change_type)
    writer.write_string_value("clientState", @client_state)
    writer.write_string_value("creatorId", @creator_id)
    writer.write_string_value("encryptionCertificate", @encryption_certificate)
    writer.write_string_value("encryptionCertificateId", @encryption_certificate_id)
    writer.write_date_time_value("expirationDateTime", @expiration_date_time)
    writer.write_boolean_value("includeResourceData", @include_resource_data)
    writer.write_string_value("latestSupportedTlsVersion", @latest_supported_tls_version)
    writer.write_string_value("lifecycleNotificationUrl", @lifecycle_notification_url)
    writer.write_string_value("notificationQueryOptions", @notification_query_options)
    writer.write_string_value("notificationUrl", @notification_url)
    writer.write_string_value("notificationUrlAppId", @notification_url_app_id)
    writer.write_string_value("resource", @resource)
end