o
    ,if                     @   s@   d dl Z d dlmZ d dlmZ d dlmZ G dd deZdS )    N)Optional)Entity)ServiceOperationQueryc                       s   e Zd ZdZdd Zedd Zedd Zedd	 Zed
d Z	edd Z
edd Zedd Zedd Zedd Zedd Zedd Zedd Zd fdd	Z  ZS ) SubscriptionzkA subscription allows a client app to receive change notifications about changes to data in Microsoft Graphc                 C   s   t | d}| j| | S )zPReauthorize a subscription when you receive a reauthorizationRequired challenge.reauthorize)r   context	add_query)selfqry r   ]/var/www/html/corbot_env/lib/python3.10/site-packages/office365/subscriptions/subscription.pyr      s   
zSubscription.reauthorizec                 C      | j ddS )zP
        Identifier of the application used to create the subscription.
        applicationIdN
propertiesgetr	   r   r   r   application_id      zSubscription.application_idc                 C   r   )ax  
        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.
        
changeTypeNr   r   r   r   r   change_type   s   zSubscription.change_typec                 C   r   )a  
        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.
        clientStateNr   r   r   r   r   client_state)      	zSubscription.client_statec                 C   r   )a  
        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.
        	creatorIdNr   r   r   r   r   
creator_id4   r   zSubscription.creator_idc                 C   r   )z
        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.
        encryptionCertificateNr   r   r   r   r   encryption_certificate?   s   z#Subscription.encryption_certificatec                 C   r   )z~
        Optional. A custom app-provided identifier to help identify the certificate needed to decrypt resource data.
        encryptionCertificateIdNr   r   r   r   r   encryption_certificate_idH   r   z&Subscription.encryption_certificate_idc                 C   s   | j dtjS )z
        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
        expirationDateTime)r   r   datetimer   r   r   r   expiration_datetimeP   s   z Subscription.expiration_datetimec                 C   r   )z}
        Optional. When set to true, change notifications include resource data (such as content of a chat message).
        includeResourceDataNr   r   r   r   r   include_resource_dataY   r   z"Subscription.include_resource_datac                 C   r   )a4  
        Optional. 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.
        latestSupportedTlsVersionNr   r   r   r   r   latest_supported_tls_versiona   s   z)Subscription.latest_supported_tls_versionc                 C   r   )a  
        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.
        lifecycleNotificationUrlNr   r   r   r   r   lifecycle_notification_urlr   r   z'Subscription.lifecycle_notification_urlc                 C   r   )a@  
        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.
        notificationUrlNr   r   r   r   r   notification_url}      zSubscription.notification_urlc                 C   r   )z
        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.
        resourceNr   r   r   r   r   r,      r+   zSubscription.resourceNc                    s0   |d u rd| j i}||d }tt| ||S )Nr    )r"   r   superr   get_property)r	   namedefault_valueproperty_mapping	__class__r   r   r.      s
   zSubscription.get_property)N)__name__
__module____qualname____doc__r   propertyr   r   r   r   r   r   r"   r$   r&   r(   r*   r,   r.   __classcell__r   r   r2   r   r      s8    













	
	r   )r!   typingr   office365.entityr   +office365.runtime.queries.service_operationr   r   r   r   r   r   <module>   s
    