Search in sources :

Example 1 with GoogleAccountCredential

use of com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential in project SeriesGuide by UweTrottmann.

the class HexagonTools method buildAccountService.

/**
     * Creates and returns a new instance for this hexagon service or null if not signed in.
     */
@Nullable
public synchronized Account buildAccountService() {
    GoogleAccountCredential credential = getAccountCredential(true);
    if (credential.getSelectedAccount() == null) {
        return null;
    }
    Account.Builder builder = new Account.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential);
    return CloudEndpointUtils.updateBuilder(app, builder).build();
}
Also used : GoogleSignInAccount(com.google.android.gms.auth.api.signin.GoogleSignInAccount) Account(com.uwetrottmann.seriesguide.backend.account.Account) GoogleAccountCredential(com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential) Nullable(android.support.annotation.Nullable)

Example 2 with GoogleAccountCredential

use of com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential in project SeriesGuide by UweTrottmann.

the class HexagonTools method getMoviesService.

/**
     * Returns the instance for this hexagon service or null if not signed in.
     */
@Nullable
public synchronized Movies getMoviesService() {
    GoogleAccountCredential credential = getAccountCredential(true);
    if (credential.getSelectedAccount() == null) {
        return null;
    }
    if (moviesService == null) {
        Movies.Builder builder = new Movies.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential);
        moviesService = CloudEndpointUtils.updateBuilder(app, builder).build();
    }
    return moviesService;
}
Also used : GoogleAccountCredential(com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential) Movies(com.uwetrottmann.seriesguide.backend.movies.Movies) Nullable(android.support.annotation.Nullable)

Example 3 with GoogleAccountCredential

use of com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential in project SeriesGuide by UweTrottmann.

the class HexagonTools method getEpisodesService.

/**
     * Returns the instance for this hexagon service or null if not signed in.
     */
@Nullable
public synchronized Episodes getEpisodesService() {
    GoogleAccountCredential credential = getAccountCredential(true);
    if (credential.getSelectedAccount() == null) {
        return null;
    }
    if (episodesService == null) {
        Episodes.Builder builder = new Episodes.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential);
        episodesService = CloudEndpointUtils.updateBuilder(app, builder).build();
    }
    return episodesService;
}
Also used : GoogleAccountCredential(com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential) Episodes(com.uwetrottmann.seriesguide.backend.episodes.Episodes) Nullable(android.support.annotation.Nullable)

Example 4 with GoogleAccountCredential

use of com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential in project SeriesGuide by UweTrottmann.

the class HexagonTools method getShowsService.

/**
     * Returns the instance for this hexagon service or null if not signed in.
     */
@Nullable
public synchronized Shows getShowsService() {
    GoogleAccountCredential credential = getAccountCredential(true);
    if (credential.getSelectedAccount() == null) {
        return null;
    }
    if (showsService == null) {
        Shows.Builder builder = new Shows.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential);
        showsService = CloudEndpointUtils.updateBuilder(app, builder).build();
    }
    return showsService;
}
Also used : GoogleAccountCredential(com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential) Shows(com.uwetrottmann.seriesguide.backend.shows.Shows) Nullable(android.support.annotation.Nullable)

Example 5 with GoogleAccountCredential

use of com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential in project SeriesGuide by UweTrottmann.

the class HexagonTools method getListsService.

/**
     * Returns the instance for this hexagon service or null if not signed in.
     */
@Nullable
public synchronized Lists getListsService() {
    GoogleAccountCredential credential = getAccountCredential(true);
    if (credential.getSelectedAccount() == null) {
        return null;
    }
    if (listsService == null) {
        Lists.Builder builder = new Lists.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential);
        listsService = CloudEndpointUtils.updateBuilder(app, builder).build();
    }
    return listsService;
}
Also used : GoogleAccountCredential(com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential) Lists(com.uwetrottmann.seriesguide.backend.lists.Lists) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)5 GoogleAccountCredential (com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential)5 GoogleSignInAccount (com.google.android.gms.auth.api.signin.GoogleSignInAccount)1 Account (com.uwetrottmann.seriesguide.backend.account.Account)1 Episodes (com.uwetrottmann.seriesguide.backend.episodes.Episodes)1 Lists (com.uwetrottmann.seriesguide.backend.lists.Lists)1 Movies (com.uwetrottmann.seriesguide.backend.movies.Movies)1 Shows (com.uwetrottmann.seriesguide.backend.shows.Shows)1