<commit_before>using System;
using System.Collections.Generic;
using System.Linq;
using {{=it.packageName}}.Api;
using {{=it.packageName}}.Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using WebSocketSharp;

namespace {{=it.packageName}}.Extensions.Notifications
{
    /// <summary>
    /// A helper class for handling PureCloud notifications
    /// </summary>
    public class NotificationHandler : IDisposable
    {
        private readonly NotificationsApi _notificationsApi = new NotificationsApi();
        private readonly Dictionary<string, Type> _typeMap = new Dictionary<string, Type>(); 

        /// <summary>
        /// The WebSocket object used to receive notifications
        /// </summary>
        public WebSocket WebSocket { get; private set; }

        /// <summary>
        /// The notification channel object
        /// </summary>
        public Channel Channel { get; private set; }

        /// <summary>
        /// The handler for a notification event
        /// </summary>
        /// <param name="notificationData">The notification data, of </param>
        public delegate void NotificationReceivedHandler(INotificationData notificationData);

        /// <summary>
        /// Raised when a notification occurs
        /// </summary>
        public event NotificationReceivedHandler NotificationReceived;

        /// <summary>
        /// Creates a new instance of NotificationHandler
        /// </summary>
        public NotificationHandler()
        {
            Websocket.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12;
            Channel = _notificationsApi.PostNotificationsChannels();
            ConnectSocket(Channel.ConnectUri);
        }

        /// <summary>
        /// Creates a new instance of NotificationHandler from an existing <see cref="Channel"/>
        /// </summary>
        public NotificationHandler(Channel channel)
        {
            Websocket.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12;
            Channel = channel;
            ConnectSocket(Channel.ConnectUri);
        }

        /// <summary>
        /// Adds a subsciption to the specified topic. Events received on this topic will be cast to the given type.
        /// </summary><commit_msg>API-3490 use TLS 1.2 for websockets<commit_after>using System;
using System.Collections.Generic;
using System.Linq;
using {{=it.packageName}}.Api;
using {{=it.packageName}}.Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using WebSocketSharp;

namespace {{=it.packageName}}.Extensions.Notifications
{
    /// <summary>
    /// A helper class for handling PureCloud notifications
    /// </summary>
    public class NotificationHandler : IDisposable
    {
        private readonly NotificationsApi _notificationsApi = new NotificationsApi();
        private readonly Dictionary<string, Type> _typeMap = new Dictionary<string, Type>(); 

        /// <summary>
        /// The WebSocket object used to receive notifications
        /// </summary>
        public WebSocket WebSocket { get; private set; }

        /// <summary>
        /// The notification channel object
        /// </summary>
        public Channel Channel { get; private set; }

        /// <summary>
        /// The handler for a notification event
        /// </summary>
        /// <param name="notificationData">The notification data, of </param>
        public delegate void NotificationReceivedHandler(INotificationData notificationData);

        /// <summary>
        /// Raised when a notification occurs
        /// </summary>
        public event NotificationReceivedHandler NotificationReceived;

        /// <summary>
        /// Creates a new instance of NotificationHandler
        /// </summary>
        public NotificationHandler()
        {
            WebSocket.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12;
            Channel = _notificationsApi.PostNotificationsChannels();
            ConnectSocket(Channel.ConnectUri);
        }

        /// <summary>
        /// Creates a new instance of NotificationHandler from an existing <see cref="Channel"/>
        /// </summary>
        public NotificationHandler(Channel channel)
        {
            WebSocket.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12;
            Channel = channel;
            ConnectSocket(Channel.ConnectUri);
        }

        /// <summary>
        /// Adds a subsciption to the specified topic. Events received on this topic will be cast to the given type.
        /// </summary>
{'fraction_non_alphanumeric': 0.10304851867754401, 'fraction_numerical': 0.0030055817947617003, 'mean_word_length': 2.366329479768786, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '684104', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1082, 'n_words': 322}