Class SeriesAPI


  • public final class SeriesAPI
    extends QueryResource
    Implementation of a connector for the remote API's Series endpoint.


    Provides static access to all routes of this endpoint which may be used to gather information about a specific series.

    • Method Detail

      • get

        public static com.fasterxml.jackson.databind.JsonNode get​(@Nonnull
                                                                  APIConnection con,
                                                                  long id)
                                                           throws APIException
        Returns detailed information for a specific series as raw JSON.


        Corresponds to remote API route: [GET] /series/{id}

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        Returns:
        JSON object containing detailed information for a specific series
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc.
      • getHead

        public static com.fasterxml.jackson.databind.JsonNode getHead​(@Nonnull
                                                                      APIConnection con,
                                                                      long id)
                                                               throws APIException
        Returns header information for a specific series as raw JSON. Good for getting the Last-Updated header to find out when the series was last modified.


        Corresponds to remote API route: [HEAD] /series/{id}

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        Returns:
        Artificial JSON object based on the HTML header information returned by the remote service
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc.
      • getActors

        public static com.fasterxml.jackson.databind.JsonNode getActors​(@Nonnull
                                                                        APIConnection con,
                                                                        long id)
                                                                 throws APIException
        Returns the actors for a specific series as raw JSON.


        Corresponds to remote API route: [GET] /series/{id}/actors

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        Returns:
        JSON object containing the actors for a specific series
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc.
      • getEpisodes

        public static com.fasterxml.jackson.databind.JsonNode getEpisodes​(@Nonnull
                                                                          APIConnection con,
                                                                          long id,
                                                                          @CheckForNull
                                                                          QueryParameters params)
                                                                   throws APIException
        Returns all episodes of a specific series as raw JSON. Results will be paginated with 100 results per page. Use params to select a specific result page.


        Corresponds to remote API route: [GET] /series/{id}/episodes

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        params - Object containing key/value pairs of query parameters. For a complete list of possible parameters see the API documentation.
        Returns:
        JSON object containing a single result page of episodes
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc.
      • queryEpisodes

        public static com.fasterxml.jackson.databind.JsonNode queryEpisodes​(@Nonnull
                                                                            APIConnection con,
                                                                            long id,
                                                                            @CheckForNull
                                                                            QueryParameters params)
                                                                     throws APIException
        Returns all matching episodes of a specific series as raw JSON. Results will be paginated. Use params to filter for specific episodes or to select a specific result page.


        Corresponds to remote API route: [GET] /series/{id}/episodes/query

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        params - Object containing key/value pairs of query parameters. For a complete list of possible query parameters see the API documentation or use getEpisodesQueryParams(con, id).
        Returns:
        JSON object containing a single result page of queried episode records
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc. or if no records are found that match your query.
      • getEpisodesQueryParams

        public static com.fasterxml.jackson.databind.JsonNode getEpisodesQueryParams​(@Nonnull
                                                                                     APIConnection con,
                                                                                     long id)
                                                                              throws APIException
        Returns a list of keys which are valid parameters for querying episodes, as raw JSON. These keys are permitted to be used in QueryParameters objects when querying for specific episodes of a series.


        Corresponds to remote API route: [GET] /series/{id}/episodes/query/params

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        Returns:
        JSON object containing all allowed keys to be used for querying episodes
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc.
      • getEpisodesSummary

        public static com.fasterxml.jackson.databind.JsonNode getEpisodesSummary​(@Nonnull
                                                                                 APIConnection con,
                                                                                 long id)
                                                                          throws APIException
        Returns a summary of the episodes and seasons available for a series, as raw JSON.
        Note: Season "0" is for all episodes that are considered to be specials.


        Corresponds to remote API route: [GET] /series/{id}/episodes/summary

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        Returns:
        JSON object containing a summary of the episodes and seasons available for the given series
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc.
      • filter

        public static com.fasterxml.jackson.databind.JsonNode filter​(@Nonnull
                                                                     APIConnection con,
                                                                     long id,
                                                                     @CheckForNull
                                                                     QueryParameters params)
                                                              throws APIException
        Returns a filtered series record based on the given parameters, as raw JSON.


        Corresponds to remote API route: [GET] /series/{id}/filter

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        params - Object containing key/value pairs of query parameters. For a complete list of possible query parameters see the API documentation or use getFilterParams(con, seriesId).
        Returns:
        JSON object containing a filtered series record
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc.
      • getFilterParams

        public static com.fasterxml.jackson.databind.JsonNode getFilterParams​(@Nonnull
                                                                              APIConnection con,
                                                                              long id)
                                                                       throws APIException
        Returns a list of keys which are valid parameters for filtering series, as raw JSON. These keys are permitted to be used in QueryParameters objects when filtering for a specific series.


        Corresponds to remote API route: [GET] /series/{id}/filter/params

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        Returns:
        JSON object containing a list of all keys allowed to filter by
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc.
      • getImages

        public static com.fasterxml.jackson.databind.JsonNode getImages​(@Nonnull
                                                                        APIConnection con,
                                                                        long id)
                                                                 throws APIException
        Returns a summary of the images types and counts available for a particular series, as raw JSON.


        Corresponds to remote API route: [GET] /series/{id}/images

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        Returns:
        JSON object containing a summary of the image types and counts available for the given series
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc.
      • queryImages

        public static com.fasterxml.jackson.databind.JsonNode queryImages​(@Nonnull
                                                                          APIConnection con,
                                                                          long id,
                                                                          @CheckForNull
                                                                          QueryParameters params)
                                                                   throws APIException
        Returns the matching result of querying images for a specific series, as raw JSON.


        Corresponds to remote API route: [GET] /series/{id}/images/query

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        params - Object containing key/value pairs of query parameters. For a complete list of possible query parameters see the API documentation or use getImagesQueryParams(con, seriesId).
        Returns:
        JSON object containing images that matched the query
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc. or if no records are found that match your query.
      • getImagesQueryParams

        public static com.fasterxml.jackson.databind.JsonNode getImagesQueryParams​(@Nonnull
                                                                                   APIConnection con,
                                                                                   long id)
                                                                            throws APIException
        Returns a list of valid parameters for querying a series images, as raw JSON. Unlike other routes, querying for a series images may be restricted to certain combinations of query keys. The allowed combinations are clustered in the data array of the returned JSON object.


        Corresponds to remote API route: [GET] /series/{id}/images/query/params

        Parameters:
        con - Initialized connection to be used for API communication
        id - The TheTVDB.com series ID
        Returns:
        JSON object containing a list of possible parameters which may be used to query a series images
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, the given series ID does not exist, etc.