package cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.balance.Balance;
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.transactions.Transactions;
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.transactions.TransactionsWithParams;
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
import cz.moneta.test.harness.support.rest.Builders;
import cz.moneta.test.harness.support.rest.RestRequest;

public class IdBuilder {
    private final Harness harness;

    public IdBuilder(Harness harness) {
        this.harness = harness;
    }

    public Balance prepareBalanceRequest() {
        return getBuilder(Balance.class);
    }

    public Transactions prepareTransactionsRequest() {
        return getBuilder(Transactions.class);
    }

    public TransactionsWithParams prepareTransactionsWithParamsRequest() {
        return getBuilder(TransactionsWithParams.class);
    }

    private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
        return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
    }
}