
/* Classes representing the possible response objects for
   The News API 'everything', 'top-headlines', and 'sources'
   queries.
   https://newsapi.org/docs
*/

// Ahmed Bouchefra, March 2020
// Modified by Andrew Davison, ad@coe.psu.ac.th, July 2023



import java.util.*;



class News
// https://newsapi.org/docs/endpoints/everything
// https://newsapi.org/docs/endpoints/top-headlines
{
  String status;
  int totalResults;
  ArrayList<Article> articles;
}

class Article
{
  Source source;
  String author;
  String title;
  String description;
  String url;
  String urlToImage;
  String publishedAt;
  String content;
}


class Source
{
  String id;
  String name;
}


class NewsError 
{
  String status;
  String code;
  String message;
}

// --------------------------------

class NewsSources
// https://newsapi.org/docs/endpoints/sources
{
  String status;
  ArrayList<NewsSource> sources;
}


class NewsSource
{
  String id;
  String name;
  String description;
  String url;
  String category;
  String language;
  String country;
}
