package io.synor.contract;

/**
 * Configuration for the Contract SDK client.
 */
public class ContractConfig {
    private final String apiKey;
    private String endpoint = "https://contract.synor.io";
    private long timeoutMs = 30000;
    private int retries = 3;

    public ContractConfig(String apiKey) {
        if (apiKey == null || apiKey.isEmpty()) {
            throw new IllegalArgumentException("API key is required");
        }
        this.apiKey = apiKey;
    }

    public ContractConfig endpoint(String endpoint) {
        this.endpoint = endpoint;
        return this;
    }

    public ContractConfig timeoutMs(long timeoutMs) {
        this.timeoutMs = timeoutMs;
        return this;
    }

    public ContractConfig retries(int retries) {
        this.retries = retries;
        return this;
    }

    public String getApiKey() {
        return apiKey;
    }

    public String getEndpoint() {
        return endpoint;
    }

    public long getTimeoutMs() {
        return timeoutMs;
    }

    public int getRetries() {
        return retries;
    }
}
