public async Task CreateSiteRmAndFolders(SitePaging sites, RMSiteARM configSiteRM, List <GroupModel> configGroups)
        {
            var guid = sites.List.Entries.ToList().Find(x => x.Entry.Id == "rm")?.Entry?.Guid;

            if (guid == null)
            {
                try
                {
                    configSiteRM.FillQueryParams();

                    var createdSite = await _alfrescoHttpClient.CreateSiteRM(configSiteRM.Body);

                    guid = createdSite.Entry.Guid;
                }
                catch (Exception ex)
                {
                    Log.Error(ex, "CreateSiteRmAndFolders Fail");
                }
            }

            await CheckCreatePermissions(guid, configSiteRM.Permissions);
            await CheckCreatePermissionsForDocumentLibrary("rm", configSiteRM.Permissions);

            if (configSiteRM?.Childs?.Count > 0 && guid != null)
            {
                await CheckSiteChilds(true, configSiteRM.Childs, false, guid, configGroups);
            }
        }
        public async Task CreateSitesAndFolders(SitePaging sites, List <SiteARM> configSites, List <GroupModel> configGroups)
        {
            foreach (SiteARM configSite in configSites)
            {
                if (configSite.Body?.Id == null)
                {
                    continue;
                }

                var guid = sites.List.Entries.ToList().Find(x => x.Entry.Id == configSite.Body.Id)?.Entry?.Guid;

                configSite.FillQueryParams();

                if (guid == null)
                {
                    try
                    {
                        var createdSite = await _alfrescoHttpClient.CreateSite(configSite.Body);

                        guid = createdSite.Entry.Guid;
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex, "CreateSitesAndFolders Fail");
                    }
                }

                await CheckCreatePermissions(guid, configSite.Permissions);
                await CheckCreatePermissionsForDocumentLibrary(configSite.Body.Id, configSite.Permissions);

                if (configSite?.Childs?.Count > 0 && guid != null)
                {
                    await CheckSiteChilds(false, configSite.Childs, configSite.GroupStructure == true, guid, configGroups);
                }
            }
        }