package cz.moneta.test.dsl.cagw.api.v4.token;

import cz.moneta.test.dsl.Harness;
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 TokenBuilder {

    private final Harness harness;

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

    public ApiV4Token prepareTokenRequest() {
        return getBuilder(ApiV4Token.class);
    }

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