private async Task <List <int> > GetContentIdsAsync(ContentStatus status, string token, ResourceType type) { var ids = new List <int>(); switch (type) { case ResourceType _ when type == ResourceTypes.Exhibit: var exhibitsClient = new ExhibitsClient(_endpointConfig.DataStoreUrl) { Authorization = token }; var exhibits = await exhibitsClient.GetAsync(status : status); foreach (var exhibit in exhibits.Items) { if (UserPermissions.IsAllowedToGetHistory(User.Identity, exhibit.UserId)) { ids.Add(exhibit.Id); } } break; case ResourceType _ when type == ResourceTypes.Route: var routesClient = new RoutesClient(_endpointConfig.DataStoreUrl) { Authorization = token }; var routes = await routesClient.GetAsync(status : status); foreach (var route in routes.Items) { if (UserPermissions.IsAllowedToGetHistory(User.Identity, route.UserId)) { ids.Add(route.Id); } } break; case ResourceType _ when type == ResourceTypes.Tag: var tagsClient = new TagsClient(_endpointConfig.DataStoreUrl) { Authorization = token }; var tags = await tagsClient.GetAllAsync(status : status); foreach (var tag in tags.Items) { if (UserPermissions.IsAllowedToGetHistory(User.Identity, tag.UserId)) { ids.Add(tag.Id); } } break; case ResourceType _ when type == ResourceTypes.Media: var mediaClient = new MediaClient(_endpointConfig.DataStoreUrl) { Authorization = token }; var media = await mediaClient.GetAsync(status : status); foreach (var medium in media.Items) { if (UserPermissions.IsAllowedToGetHistory(User.Identity, medium.UserId)) { ids.Add(medium.Id); } } break; case ResourceType _ when type == ResourceTypes.ExhibitPage: var exhibitPagesClient = new ExhibitPagesClient(_endpointConfig.DataStoreUrl) { Authorization = token }; var exhibitPages = await exhibitPagesClient.GetAllPagesAsync(status : status); foreach (var exhibitPage in exhibitPages.Items) { if (UserPermissions.IsAllowedToGetHistory(User.Identity, exhibitPage.UserId)) { ids.Add(exhibitPage.Id); } } break; } return(ids); }