package cz.moneta.test.dsl.auto.autoapi.lamder.authentication;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.auto.autoapi.lamder.authentication.login.Login;
import cz.moneta.test.harness.endpoints.autoapi.AutoApiEndpoint;
import cz.moneta.test.harness.support.rest.Builders;
import cz.moneta.test.harness.support.rest.RestRequest;

public class AuthenticationBuilder {
    private final Harness harness;

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

    public Login prepareLoginRequest() {
        return getBuilder(Login.class);
    }

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