package cz.moneta.test.dsl.cagw;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.cagw.api.ApiBuilder;
import cz.moneta.test.dsl.cagw.auth.AuthBuilder;
import cz.moneta.test.dsl.cagw.oauth2.Oauth2Builder;
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 CaGwBuilder {

    private final Harness harness;

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

    public ApiBuilder api() {
        return new ApiBuilder(harness);
    }

    public Oauth2Builder oauth2() {
        return new Oauth2Builder(harness);
    }

    public AuthBuilder auth() {
        return new AuthBuilder(harness);
    }

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