using Umbraco.Cms.Core.Models.PublishedContent;
namespace Umbraco.Cms.Core.PublishedCache;
///
/// Provides access to cached contents.
///
public interface IPublishedCache
{
///
/// Gets a content identified by its unique identifier.
///
/// A value indicating whether to consider unpublished content.
/// The content unique identifier.
/// The content, or null.
/// The value of overrides defaults.
IPublishedContent? GetById(bool preview, int contentId);
///
/// Gets a content identified by its unique identifier.
///
/// A value indicating whether to consider unpublished content.
/// The content unique identifier.
/// The content, or null.
/// The value of overrides defaults.
IPublishedContent? GetById(bool preview, Guid contentId);
///
/// Gets a content identified by its Udi identifier.
///
/// A value indicating whether to consider unpublished content.
/// The content Udi identifier.
/// The content, or null.
/// The value of overrides defaults.
[Obsolete] // FIXME: Remove when replacing nucache
IPublishedContent? GetById(bool preview, Udi contentId);
///
/// Gets a content identified by its unique identifier.
///
/// The content unique identifier.
/// The content, or null.
/// Considers published or unpublished content depending on defaults.
IPublishedContent? GetById(int contentId);
///
/// Gets a content identified by its unique identifier.
///
/// The content unique identifier.
/// The content, or null.
/// Considers published or unpublished content depending on defaults.
IPublishedContent? GetById(Guid contentId);
///
/// Gets a content identified by its unique identifier.
///
/// The content unique identifier.
/// The content, or null.
/// Considers published or unpublished content depending on defaults.
[Obsolete] // FIXME: Remove when replacing nucache
IPublishedContent? GetById(Udi contentId);
///
/// Gets contents at root.
///
/// A value indicating whether to consider unpublished content.
/// A culture.
/// The contents.
/// The value of overrides defaults.
[Obsolete("Scheduled for removal, use IDocumentNavigationQueryService instead in v17")]
IEnumerable GetAtRoot(bool preview, string? culture = null);
///
/// Gets contents at root.
///
/// A culture.
/// The contents.
/// Considers published or unpublished content depending on defaults.
[Obsolete("Scheduled for removal, use IDocumentNavigationQueryService instead in v17")]
IEnumerable GetAtRoot(string? culture = null);
///
/// Gets a value indicating whether the cache contains published content.
///
/// A value indicating whether to consider unpublished content.
/// A value indicating whether the cache contains published content.
/// The value of overrides defaults.
[Obsolete("Scheduled for removal in v17")]
bool HasContent(bool preview);
///
/// Gets a value indicating whether the cache contains published content.
///
/// A value indicating whether the cache contains published content.
/// Considers published or unpublished content depending on defaults.
[Obsolete("Scheduled for removal in v17")]
bool HasContent();
///
/// Gets a content type identified by its unique identifier.
///
/// The content type unique identifier.
/// The content type, or null.
[Obsolete("Please use the IContentTypeCacheService instead, scheduled for removal in V16")]
IPublishedContentType? GetContentType(int id);
///
/// Gets a content type identified by its alias.
///
/// The content type alias.
/// The content type, or null.
/// The alias is case-insensitive.
[Obsolete("Please use the IContentTypeCacheService instead, scheduled for removal in V16")]
IPublishedContentType? GetContentType(string alias);
///
/// Gets contents of a given content type.
///
/// The content type.
/// The contents.
[Obsolete]
IEnumerable GetByContentType(IPublishedContentType contentType);
///
/// Gets a content type identified by its alias.
///
/// The content type key.
/// The content type, or null.
[Obsolete("Please use the IContentTypeCacheService instead, scheduled for removal in V16")]
IPublishedContentType? GetContentType(Guid key);
}