Search in sources :

Example 1 with RequestRate

use of io.swagger.client.model.RequestRate in project android-client by GenesisVision.

the class RateManager method getRate.

public BehaviorSubject<Double> getRate(String from, String to) {
    BehaviorSubject<Double> rateSubject = getRateSubject(from, to);
    RequestRate model = new RequestRate();
    model.setFrom(RequestRate.FromEnum.fromValue(from));
    model.setTo(RequestRate.ToEnum.fromValue(to));
    rateSubscription = rateApi.apiRatePost(model).observeOn(Schedulers.io()).subscribeOn(Schedulers.io()).subscribe(response -> handleGetRateResponse(response, rateSubject), this::handleGetRateError);
    return rateSubject;
}
Also used : Pair(android.util.Pair) RateViewModel(io.swagger.client.model.RateViewModel) Schedulers(rx.schedulers.Schedulers) BehaviorSubject(rx.subjects.BehaviorSubject) HashMap(java.util.HashMap) RateApi(io.swagger.client.api.RateApi) Subscription(rx.Subscription) RequestRate(io.swagger.client.model.RequestRate) RequestRate(io.swagger.client.model.RequestRate)

Aggregations

Pair (android.util.Pair)1 RateApi (io.swagger.client.api.RateApi)1 RateViewModel (io.swagger.client.model.RateViewModel)1 RequestRate (io.swagger.client.model.RequestRate)1 HashMap (java.util.HashMap)1 Subscription (rx.Subscription)1 Schedulers (rx.schedulers.Schedulers)1 BehaviorSubject (rx.subjects.BehaviorSubject)1