import ai.leadping.openapi.LeadpingOpenApiClient;
import com.microsoft.kiota.authentication.ApiKeyAuthenticationProvider;
import com.microsoft.kiota.authentication.ApiKeyLocation;
import com.microsoft.kiota.http.OkHttpRequestAdapter;
String credential = System.getenv("LEADPING_API_KEY");
if (credential == null || credential.isBlank()) {
throw new IllegalStateException("LEADPING_API_KEY is not set.");
}
var authProvider = new ApiKeyAuthenticationProvider(
"Bearer " + credential,
"Authorization",
ApiKeyLocation.HEADER,
"api.leadping.ai");
var client = new LeadpingOpenApiClient(new OkHttpRequestAdapter(authProvider));
var lead = client.leads().byId("lead-id").get();