NewsApiResponseDTO

@Serializable
data class NewsApiResponseDTO(val status: String, val totalResults: Int? = null, val articles: List<ArticleDTO>? = null, val code: String? = null, val message: String? = null)

Represents the top-level response from the NewsAPI v2 /everything endpoint.

Constructors

Link copied to clipboard
constructor(status: String, totalResults: Int? = null, articles: List<ArticleDTO>? = null, code: String? = null, message: String? = null)

Properties

Link copied to clipboard
@SerialName(value = "articles")
val articles: List<ArticleDTO>?
Link copied to clipboard
@SerialName(value = "code")
val code: String?
Link copied to clipboard
@SerialName(value = "message")
val message: String?
Link copied to clipboard
@SerialName(value = "status")
val status: String
Link copied to clipboard
@SerialName(value = "totalResults")
val totalResults: Int?

Functions

Link copied to clipboard

Maps the entire NewsApiResponseDTO to a list of domain Article models. It filters out unsuccessful responses and any articles that fail to parse.