All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.uwetrottmann.tmdb2.services.SearchService Maven / Gradle / Ivy

There is a newer version: 2.11.0
Show newest version
package com.uwetrottmann.tmdb2.services;

import com.uwetrottmann.tmdb2.entities.CollectionResultsPage;
import com.uwetrottmann.tmdb2.entities.CompanyResultsPage;
import com.uwetrottmann.tmdb2.entities.KeywordResultsPage;
import com.uwetrottmann.tmdb2.entities.MediaResultsPage;
import com.uwetrottmann.tmdb2.entities.MovieResultsPage;
import com.uwetrottmann.tmdb2.entities.PersonResultsPage;
import com.uwetrottmann.tmdb2.entities.TvShowResultsPage;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

public interface SearchService {

    /**
     * Search for companies by name.
     *
     * @param query CGI escaped string
     * @param page  Optional. Minimum value is 1, expected value is an integer.
     */
    @GET("search/company")
    Call company(
            @Query("query") String query,
            @Query("page") Integer page
    );

    /**
     * Search for collections by name.
     *
     * @param query    CGI escaped string
     * @param page     Optional. Minimum value is 1, expected value is an integer.
     * @param language Optional. ISO 639-1 code.
     */
    @GET("search/collection")
    Call collection(
            @Query("query") String query,
            @Query("page") Integer page,
            @Query("language") String language
    );

    /**
     * Search for keywords by name.
     *
     * @param query CGI escaped string
     * @param page  Optional. Minimum value is 1, expected value is an integer.
     */
    @GET("search/keyword")
    Call keyword(
            @Query("query") String query,
            @Query("page") Integer page
    );

    /**
     * Search for movies by title.
     *
     * @param query              CGI escaped string
     * @param page               Optional. Minimum value is 1, expected value is an integer.
     * @param language           Optional. ISO 639-1 code.
     * @param includeAdult       Optional. Toggle the inclusion of adult titles. Expected value is: true or false
     * @param year               Optional. Filter the results release dates to matches that include this value.
     * @param primaryReleaseYear Optional. Filter the results so that only the primary release dates have this
     *                           value.
     * @param searchType         Optional. By default, the search type is 'phrase'. This is almost guaranteed the
     *                           option you will want. It's a great all purpose search type and by far the most tuned for every day querying. For
     *                           those wanting more of an "autocomplete" type search, set this option to 'ngram'.
     */
    @GET("search/movie")
    Call movie(
            @Query("query") String query,
            @Query("page") Integer page,
            @Query("language") String language,
            @Query("include_adult") Boolean includeAdult,
            @Query("year") Integer year,
            @Query("primary_release_year") Integer primaryReleaseYear,
            @Query("search_type") String searchType
    );

    /**
     * Search for movies by title.
     *
     * @param query        CGI escaped string
     * @param page         Optional. Minimum value is 1, expected value is an integer.
     * @param language     Optional. ISO 639-1 code.
     * @param includeAdult Optional. Toggle the inclusion of adult titles. Expected value is: true or false
     * @param region       Optional. ISO 3166-1 code.
     */
    @GET("search/multi")
    Call multi(
            @Query("query") String query,
            @Query("page") Integer page,
            @Query("language") String language,
            @Query("include_adult") Boolean includeAdult,
            @Query("region") String region
    );

    /**
     * Search for people by name.
     *
     * @param query        CGI escaped string
     * @param page         Optional. Minimum value is 1, expected value is an integer.
     * @param includeAdult Optional. Toggle the inclusion of adult titles. Expected value is: true or false
     * @param searchType   Optional. By default, the search type is 'phrase'. This is almost guaranteed the
     *                     option you will want. It's a great all purpose search type and by far the most tuned for every day querying. For
     *                     those wanting more of an "autocomplete" type search, set this option to 'ngram'.
     */
    @GET("search/person")
    Call person(
            @Query("query") String query,
            @Query("page") Integer page,
            @Query("language") String language,
            @Query("include_adult") Boolean includeAdult,
            @Query("search_type") String searchType
    );

    /**
     * Search for TV shows by title.
     *
     * @param query            CGI escaped string
     * @param page             Minimum 1, maximum 1000.
     * @param language         ISO 639-1 code.
     * @param firstAirDateYear Filter the results to only match shows that have an air date with this value.
     * @param searchType       By default, the search type is 'phrase'. This is almost guaranteed the option you will want.
     *                         It's a great all purpose search type and by far the most tuned for every day querying. For those wanting more of
     *                         an "autocomplete" type search, set this option to 'ngram'.
     */
    @GET("search/tv")
    Call tv(
            @Query("query") String query,
            @Query("page") Integer page,
            @Query("language") String language,
            @Query("first_air_date_year") Integer firstAirDateYear,
            @Query("search_type") String searchType
    );
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy