/// <summary>
        /// Constructor FileApi object using clientId (from Azure AD), application friendly name, and ClaimsPrincipal representing the user
        /// </summary>
        /// <param name="clientId">Client is the Application ID displayed in the Azure AD App Registration Portal</param>
        /// <param name="applicationName">The application friendly name</param>
        /// <param name="claimsPrincipal">ClaimsPrincipal representing the authenticated user</param>
        public FileApi(string clientId, string applicationName, string applicationVersion, ClaimsPrincipal claimsPrincipal)
        {
            // Store ApplicationInfo and ClaimsPrincipal for SDK operations.
            appInfo = new ApplicationInfo()
            {
                ApplicationId      = clientId,
                ApplicationName    = applicationName,
                ApplicationVersion = applicationVersion
            };

            // Initialize new AuthDelegate providing the claimsprincipal.
            _authDelegate = new AuthDelegateImplementation(claimsPrincipal);

            // Set path to bins folder.
            var path = Path.Combine(
                Directory.GetParent(Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath)).FullName,
                Environment.Is64BitProcess ? "bin\\x64" : "bin\\x86");

            // Initialize MIP for File API.
            MIP.Initialize(MipComponent.File, path);

            // Call CreateFileProfile. Result is stored in global.
            CreateFileProfile();

            // Call CreateFileEngine, providing the user UPN, null client data, and locale.
            CreateFileEngine(ClaimsPrincipal.Current.FindFirst(ClaimTypes.Upn).Value, "", "en-US");
        }
        /// <summary>
        /// Constructor FileApi object using clientId (from Azure AD), application friendly name, and ClaimsPrincipal representing the user
        /// </summary>
        /// <param name="clientId">Client is the Application ID displayed in the Azure AD App Registration Portal</param>
        /// <param name="applicationName">The application friendly name</param>
        /// <param name="claimsPrincipal">ClaimsPrincipal representing the authenticated user</param>
        public FileApi(string clientId, string applicationName, string applicationVersion, ClaimsPrincipal claimsPrincipal)
        {
            try
            {
                // Store ApplicationInfo and ClaimsPrincipal for SDK operations.
                _appInfo = new ApplicationInfo()
                {
                    ApplicationId      = clientId,
                    ApplicationName    = applicationName,
                    ApplicationVersion = applicationVersion
                };

                // Initialize new AuthDelegate providing the claimsprincipal.
                _authDelegate = new AuthDelegateImplementation(claimsPrincipal);

                // Set path to bins folder.
                var path = Path.Combine(
                    Directory.GetParent(Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath)).FullName, "bin");

                // Initialize MIP for File API. Provide the path to the BIN folder. The NuGet package will copy the architecture specific libraries here.
                MIP.Initialize(MipComponent.File, path);

                // Call CreateFileProfile. Result is stored in global.
                CreateFileProfile();

                // Call CreateFileEngine, providing the user UPN, null client data, and locale.
                CreateFileEngine(ClaimsPrincipal.Current.FindFirst(ClaimTypes.Upn).Value, "", "en-US");
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// Constructor FileApi object using clientId (from Azure AD), application friendly name, and ClaimsPrincipal representing the user
        /// </summary>
        /// <param name="clientId">Client is the Application ID displayed in the Azure AD App Registration Portal</param>
        /// <param name="applicationName">The application friendly name</param>
        /// <param name="claimsPrincipal">ClaimsPrincipal representing the authenticated user</param>
        public FileApi(string clientId, string applicationName, ClaimsPrincipal claimsPrincipal)
        {
            try
            {
                // Store ApplicationInfo and ClaimsPrincipal for SDK operations.
                _appInfo = new ApplicationInfo()
                {
                    ApplicationId   = clientId,
                    ApplicationName = applicationName
                };

                // Initialize new AuthDelegate providing the claimsprincipal.
                _authDelegate = new AuthDelegateImplementation(claimsPrincipal);

                // Set path to bins folder.
                var path = Path.Combine(
                    Directory.GetParent(Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath)).FullName,
                    Environment.Is64BitProcess ? "binsx64" : "binsx86");

                // Use custom UnsafeKernel32NativeMethods class to configure managed to unmanaged marshalling.
                Utilities.UnsafeKernel32NativeMethods.SetDllDirectory(path);

                // Initialize FileProfileFactory.
                FileProfileFactory.Initialize();

                // Call CreateFileProfile. Result is stored in global.
                CreateFileProfile();

                // Call CreateFileEngine, providing the user UPN, null client data, and locale.
                CreateFileEngine(ClaimsPrincipal.Current.FindFirst(ClaimTypes.Upn).Value, "", "en-US");
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }