/** * This file was auto-generated by Fern from our API Definition. */ package com.vapi.api; import com.vapi.api.core.ClientOptions; import com.vapi.api.core.Suppliers; import com.vapi.api.resources.analytics.AnalyticsClient; import com.vapi.api.resources.assistants.AssistantsClient; import com.vapi.api.resources.blocks.BlocksClient; import com.vapi.api.resources.calls.CallsClient; import com.vapi.api.resources.files.FilesClient; import com.vapi.api.resources.knowledgebases.KnowledgeBasesClient; import com.vapi.api.resources.logs.LogsClient; import com.vapi.api.resources.phonenumbers.PhoneNumbersClient; import com.vapi.api.resources.squads.SquadsClient; import com.vapi.api.resources.tools.ToolsClient; import java.util.function.Supplier; public class Vapi { protected final ClientOptions clientOptions; protected final Supplier callsClient; protected final Supplier assistantsClient; protected final Supplier phoneNumbersClient; protected final Supplier squadsClient; protected final Supplier knowledgeBasesClient; protected final Supplier blocksClient; protected final Supplier toolsClient; protected final Supplier filesClient; protected final Supplier analyticsClient; protected final Supplier logsClient; public Vapi(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.callsClient = Suppliers.memoize(() -> new CallsClient(clientOptions)); this.assistantsClient = Suppliers.memoize(() -> new AssistantsClient(clientOptions)); this.phoneNumbersClient = Suppliers.memoize(() -> new PhoneNumbersClient(clientOptions)); this.squadsClient = Suppliers.memoize(() -> new SquadsClient(clientOptions)); this.knowledgeBasesClient = Suppliers.memoize(() -> new KnowledgeBasesClient(clientOptions)); this.blocksClient = Suppliers.memoize(() -> new BlocksClient(clientOptions)); this.toolsClient = Suppliers.memoize(() -> new ToolsClient(clientOptions)); this.filesClient = Suppliers.memoize(() -> new FilesClient(clientOptions)); this.analyticsClient = Suppliers.memoize(() -> new AnalyticsClient(clientOptions)); this.logsClient = Suppliers.memoize(() -> new LogsClient(clientOptions)); } public CallsClient calls() { return this.callsClient.get(); } public AssistantsClient assistants() { return this.assistantsClient.get(); } public PhoneNumbersClient phoneNumbers() { return this.phoneNumbersClient.get(); } public SquadsClient squads() { return this.squadsClient.get(); } public KnowledgeBasesClient knowledgeBases() { return this.knowledgeBasesClient.get(); } public BlocksClient blocks() { return this.blocksClient.get(); } public ToolsClient tools() { return this.toolsClient.get(); } public FilesClient files() { return this.filesClient.get(); } public AnalyticsClient analytics() { return this.analyticsClient.get(); } public LogsClient logs() { return this.logsClient.get(); } public static VapiBuilder builder() { return new VapiBuilder(); } }