public <T> Observable<ServiceResponse<T>> getPostOrDeleteResultAsync(Observable<Response<ResponseBody>> observable, final LongRunningOperationOptions lroOptions, final Type resourceType) {
        return this.<T>beginPostOrDeleteAsync(observable, lroOptions, resourceType)
                .toObservable()
                .flatMap(new Func1<PollingState<T>, Observable<PollingState<T>>>() {
                    @Override
                    public Observable<PollingState<T>> call(PollingState<T> pollingState) {
                        return pollPostOrDeleteAsync(pollingState, resourceType);
                    }
                })
                .last()
                .map(new Func1<PollingState<T>, ServiceResponse<T>>() {
                    @Override
                    public ServiceResponse<T> call(PollingState<T> pollingState) {
                        return new ServiceResponse<>(pollingState.resource(), pollingState.response());
                    }
                });
    }
public < T > Observable < ServiceResponse < T > > getPostOrDeleteResultAsync ( Observable < Response < ResponseBody > > observable , final LongRunningOperationOptions lroOptions , final Type resourceType ) { return this . < T > beginPostOrDeleteAsync ( observable , lroOptions , resourceType ) . toObservable ( ) . flatMap ( new Func1 < PollingState < T > , Observable < PollingState < T > > > ( ) { @ Override public Observable < PollingState < T > > call ( PollingState < T > pollingState ) { return pollPostOrDeleteAsync ( pollingState , resourceType ) ; } } ) . last ( ) . map ( new Func1 < PollingState < T > , ServiceResponse < T > > ( ) { @ Override public ServiceResponse < T > call ( PollingState < T > pollingState ) { return new ServiceResponse < > ( pollingState . resource ( ) , pollingState . response ( ) ) ; } } ) ; }
Handles an initial response from a POST or DELETE operation response by polling
the status of the operation asynchronously, calling the user provided callback
when the operation terminates.

@param observable  the initial response from the POST or DELETE operation.
@param lroOptions long running operation options.
@param <T>       the return type of the caller.
@param resourceType the java.lang.reflect.Type of the resource.
@return          the task describing the asynchronous polling.