Subscriptions subs = youtube.subscriptions(); com.google.api.services.youtube.YouTube.Subscriptions.List subscribers = subs.list("id").setMine(true); // <- use setMine(), not setMySubscribers() SubscriptionListResponse resp = subscribers.execute(); ...
/** * @return the currently selected subscription this client is authenticated to work with */ public Subscription getCurrentSubscription() { return this.subscriptions().getById(this.subscriptionId()); }
public static List<Subscription> getSubscriptions(String tid) throws IOException { List<Subscription> sl = authTid(tid).subscriptions().listAsync() .onErrorResumeNext(err -> { LOGGER.warning(err.getMessage()); return Observable.empty(); }) .toList() .toBlocking() .singleOrDefault(Collections.emptyList()); return sl; }
@Override public List<Subscription> getSubscriptions() throws IOException { List<Subscription> sl = auth().subscriptions().list(); return sl; }
/** * @return the currently selected subscription this client is authenticated to work with */ public Subscription getCurrentSubscription() { return this.subscriptions().getById(this.subscriptionId()); }
Azure.Authenticated azureAuthenticated = Azure.authenticate(authFiel); fileReporter.report("Checking: azureAuthenticated.subscriptions().list()..."); azureAuthenticated.subscriptions().list(); fileReporter.report("Checking: azureAuthenticated.withDefaultSubscription()..."); Azure azure = azureAuthenticated.withDefaultSubscription();
@Override public Azure withDefaultSubscription() throws CloudException, IOException { if (this.defaultSubscription != null) { return withSubscription(this.defaultSubscription); } else { PagedList<Subscription> subs = this.subscriptions().list(); if (!subs.isEmpty()) { return withSubscription(subs.get(0).subscriptionId()); } else { return withSubscription(null); } } } }
@Override public Azure withDefaultSubscription() throws CloudException, IOException { if (this.defaultSubscription != null) { return withSubscription(this.defaultSubscription); } else { PagedList<Subscription> subs = this.subscriptions().list(); if (!subs.isEmpty()) { return withSubscription(subs.get(0).subscriptionId()); } else { return withSubscription(null); } } } }
@Test public void canListSubscriptions() throws Exception { PagedList<Subscription> subscriptions = resourceManager.subscriptions().list(); Assert.assertTrue(subscriptions.size() > 0); }
@Test public void canListLocations() throws Exception { PagedList<Location> locations = resourceManager.subscriptions().list().get(0).listLocations(); Assert.assertTrue(locations.size() > 0); } }