Gets all network watchers by subscription.

@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@return the {@link ServiceFuture} object
328967
public ServiceFuture<List<NetworkWatcherInner>> listAsync(final ServiceCallback<List<NetworkWatcherInner>> serviceCallback) {
        return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback);
    }
53175
public static <T> Observable<Response<T>> from(@NotNull final ApolloQueryWatcher<T> watcher) {
    checkNotNull(watcher, "watcher == null");
    return Observable.create(new ObservableOnSubscribe<Response<T>>() {
      @Override public void subscribe(final ObservableEmitter<Response<T>> emitter) throws Exception {
        cancelOnObservableDisposed(emitter, watcher);

        watcher.enqueueAndWatch(new ApolloCall.Callback<T>() {
          @Override public void onResponse(@NotNull Response<T> response) {
            if (!emitter.isDisposed()) {
              emitter.onNext(response);
            }
          }

          @Override public void onFailure(@NotNull ApolloException e) {
            Exceptions.throwIfFatal(e);
            if (!emitter.isDisposed()) {
              emitter.onError(e);
            }
          }
        });
      }
    });
  }
1121366
private IChannelConsumer getClientChannelForSubscription(
            String functionalityName,
            IAsyncMessageClient client) throws ServiceGroundingException
    {
        if (null != this.subscriptionsConsumerChannel)
        {
            return this.subscriptionsConsumerChannel;
        }

        this.subscriptionsConsumerChannel = createClientSubscriptionChannelFor(functionalityName);
        this.subscriptionsConsumerChannel.addClientCallback(client);
        return this.subscriptionsConsumerChannel;
    }
1209571
public Observable<Page<VpnSiteInner>> listAsync() {
        return listWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<VpnSiteInner>>, Page<VpnSiteInner>>() {
                @Override
                public Page<VpnSiteInner> call(ServiceResponse<Page<VpnSiteInner>> response) {
                    return response.body();
                }
            });
    }
1242646
public static <T> ServiceFuture<T> fromResponse(final Observable<ServiceResponse<T>> observable) {
        final ServiceFuture<T> serviceFuture = new ServiceFuture<>();
        serviceFuture.subscription = observable
            .last()
            .subscribe(new Action1<ServiceResponse<T>>() {
                @Override
                public void call(ServiceResponse<T> t) {
                    serviceFuture.set(t.body());
                }
            }, new Action1<Throwable>() {
                @Override
                public void call(Throwable throwable) {
                    serviceFuture.setException(throwable);
                }
            });
        return serviceFuture;
    }
341169
public ServiceFuture<List<ClusterInner>> listAsync(final ServiceCallback<List<ClusterInner>> serviceCallback) {
        return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback);
    }
967130
public ServiceFuture<List<ComputeOperationValueInner>> listAsync(final ServiceCallback<List<ComputeOperationValueInner>> serviceCallback) {
        return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback);
    }
840253
public Observable<ServiceResponse<ApplicationGatewayAvailableWafRuleSetsResultInner>> listAvailableWafRuleSetsWithServiceResponseAsync() {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        final String apiVersion = "2018-06-01";
        return service.listAvailableWafRuleSets(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ApplicationGatewayAvailableWafRuleSetsResultInner>>>() {
                @Override
                public Observable<ServiceResponse<ApplicationGatewayAvailableWafRuleSetsResultInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<ApplicationGatewayAvailableWafRuleSetsResultInner> clientResponse = listAvailableWafRuleSetsDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
1122236
public Observable<ServiceResponse<List<AzureSkuInner>>> listSkusWithServiceResponseAsync() {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listSkus(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<AzureSkuInner>>>>() {
                @Override
                public Observable<ServiceResponse<List<AzureSkuInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<AzureSkuInner>> result = listSkusDelegate(response);
                        List<AzureSkuInner> items = null;
                        if (result.body() != null) {
                            items = result.body().items();
                        }
                        ServiceResponse<List<AzureSkuInner>> clientResponse = new ServiceResponse<List<AzureSkuInner>>(items, result.response());
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
1022414
static synchronized List<Watcher> get(MavenSession session) {
        List<Watcher> watchers = (List<Watcher>) session.getExecutionProperties().get(WATCHERS_KEY);
        if (watchers == null) {
            watchers = new ArrayList<>();
            session.getExecutionProperties().put(WATCHERS_KEY, watchers);
        }
        return watchers;
    }
14542
public Observable<ServiceResponse<List<String>>> listDomainsWithServiceResponseAsync() {
        if (this.client.endpoint() == null) {
            throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
        }
        String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint());
        return service.listDomains(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<String>>>>() {
                @Override
                public Observable<ServiceResponse<List<String>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<List<String>> clientResponse = listDomainsDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
956738
public Observable<Page<VirtualWANInner>> listAsync() {
        return listWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<VirtualWANInner>>, Page<VirtualWANInner>>() {
                @Override
                public Page<VirtualWANInner> call(ServiceResponse<Page<VirtualWANInner>> response) {
                    return response.body();
                }
            });
    }
839220
public static <E> Collection<E> get(Class<? extends E> service) {

        Iterator<? extends E> implementations = ServiceLoader.load(service).iterator();

        Collection<E> result = new ArrayList<E>();
        while (implementations.hasNext()) {
            result.add(implementations.next());
        }
        return result;

    }
854134
protected List<RedisFuture<Void>> resubscribe() {

        List<RedisFuture<Void>> result = new ArrayList<>();

        if (endpoint.hasChannelSubscriptions()) {
            result.add(async().subscribe(toArray(endpoint.getChannels())));
        }

        if (endpoint.hasPatternSubscriptions()) {
            result.add(async().psubscribe(toArray(endpoint.getPatterns())));
        }

        return result;
    }
774833
public Observable<Page<ResourceGroupInner>> listAsync() {
        return listWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<ResourceGroupInner>>, Page<ResourceGroupInner>>() {
                @Override
                public Page<ResourceGroupInner> call(ServiceResponse<Page<ResourceGroupInner>> response) {
                    return response.body();
                }
            });
    }
112975
public static ServiceFuture<Void> fromBody(final Completable completable, final ServiceCallback<Void> callback) {
        final ServiceFuture<Void> serviceFuture = new ServiceFuture<>();
        completable.subscribe(new Action0() {
            Void value = null;
            @Override
            public void call() {
                if (callback != null) {
                    callback.success(value);
                }
                serviceFuture.set(value);
            }
        }, new Action1<Throwable>() {
            @Override
            public void call(Throwable throwable) {
                if (callback != null) {
                    callback.failure(throwable);
                }
                serviceFuture.setException(throwable);
            }
        });
        return serviceFuture;
    }
247456
public Observable<List<ImageList>> getAllImageListsAsync() {
        return getAllImageListsWithServiceResponseAsync().map(new Func1<ServiceResponse<List<ImageList>>, List<ImageList>>() {
            @Override
            public List<ImageList> call(ServiceResponse<List<ImageList>> response) {
                return response.body();
            }
        });
    }