import Foundation struct AudioRecommendationsResponse: Decodable { let banners: [AudioBannerResponse] let subBanners: [SubBanner] let originalSeries: [OriginalSeriesResponse] let latestAudios: [AudioCardResponse] let newAndHotAudios: [AudioCardResponse] let freeAudios: [AudioCardResponse] let pointAudios: [AudioCardResponse] let mostCommentedAudios: [CommentedAudioResponse] let recommendedAudios: [AudioCardResponse] var eligibleSubBanners: [SubBanner] { subBanners.filter { $0.placement == .contentRecommendation && $0.isEligible } } var isEmpty: Bool { banners.isEmpty && eligibleSubBanners.isEmpty && originalSeries.isEmpty && latestAudios.isEmpty && newAndHotAudios.isEmpty && freeAudios.isEmpty && pointAudios.isEmpty && mostCommentedAudios.isEmpty && recommendedAudios.isEmpty } } struct AudioBannerResponse: Decodable, Hashable, Identifiable { var id: String { "\(imageUrl)-\(creatorId ?? 0)-\(seriesId ?? 0)-\(link ?? "")" } let imageUrl: String let eventItem: EventItem? let creatorId: Int? let seriesId: Int? let link: String? } struct OriginalSeriesResponse: Decodable, Hashable, Identifiable { var id: Int { seriesId } let seriesId: Int let coverImageUrl: String } struct AudioCardResponse: Decodable, Hashable, Identifiable { var id: Int { audioContentId } let audioContentId: Int let title: String let duration: String let imageUrl: String let price: Int let isAdult: Bool let isPointAvailable: Bool let isFirstContent: Bool let isOriginalSeries: Bool let creatorNickname: String } struct CommentedAudioResponse: Decodable, Hashable, Identifiable { var id: Int { audioContentId } let audioContentId: Int let title: String let imageUrl: String let latestComment: String let latestCommentWriterProfileImageUrl: String }