/// <summary>
 /// Gets the first pinned matter serialized JSON object
 /// </summary>
 /// <param name="userPinnedDetails">User matter pin details object</param>
 /// <returns>JSON format of pin data</returns>
 private static string GetFirstPinnedMatter(PinUnpinDetails userPinnedDetails)
 {
     Dictionary<string, MatterData> userFirstPinnedMatter = new Dictionary<string, MatterData>();
     userFirstPinnedMatter.Add(userPinnedDetails.UserPinnedMatterData.MatterUrl, userPinnedDetails.UserPinnedMatterData);
     string pinnedDetailsJson = JsonConvert.SerializeObject(userFirstPinnedMatter, Newtonsoft.Json.Formatting.Indented);
     return pinnedDetailsJson;
 }
        /// <summary>
        /// Gets the current user pinned details.
        /// </summary>
        /// <param name="isMatterView">If the user is pinning a matter, this will be true, else will be false.</param>
        /// <param name="getUserPinnedDetails">This is an object that contains the details of the specific pinned matter/document.</param>
        /// <returns>This returns an object that contains the details of the specific pinned matter/document.</returns>
        internal static PinUnpinDetails GetCurrentUserPinnedDetails(bool isMatterView, object getUserPinnedDetails)
        {
            PinUnpinDetails userPinnedDetails = new PinUnpinDetails();
            try
            {
                if (isMatterView)
                {
                    userPinnedDetails.UserPinnedMatterData = (MatterData)getUserPinnedDetails;
                }
                else
                {
                    userPinnedDetails.UserPinnedDocumentData = (DocumentData)getUserPinnedDetails;
                }

                userPinnedDetails.ListName = isMatterView ? ServiceConstantStrings.UserPinnedMatterListName : ServiceConstantStrings.UserPinnedDocumentListName;
                userPinnedDetails.PinnedListColumnDetails = isMatterView ? ServiceConstantStrings.PinnedListColumnMatterDetails : ServiceConstantStrings.PinnedListColumnDocumentDetails;
                userPinnedDetails.URL = isMatterView ? userPinnedDetails.UserPinnedMatterData.MatterUrl : userPinnedDetails.UserPinnedDocumentData.DocumentUrl;
            }
            catch (Exception exception)
            {
                Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName);
            }

            return userPinnedDetails;
        }
 /// <summary>
 /// Gets the first pinned document serialized JSON object
 /// </summary>        
 /// <param name="userPinnedDetails">User document pin details object</param>
 /// <returns></returns>
 private static string GetFirstPinnedDocument(PinUnpinDetails userPinnedDetails)
 {
     Dictionary<string, DocumentData> userFirstPinnedDocument = new Dictionary<string, DocumentData>();
     userFirstPinnedDocument.Add(userPinnedDetails.URL, userPinnedDetails.UserPinnedDocumentData);
     string pinnedDetailsJson = JsonConvert.SerializeObject(userFirstPinnedDocument, Newtonsoft.Json.Formatting.Indented);
     return pinnedDetailsJson;
 }