forked from VapiAI/server-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVapi.java
More file actions
100 lines (76 loc) · 3.3 KB
/
Copy pathVapi.java
File metadata and controls
100 lines (76 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
* 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> callsClient;
protected final Supplier<AssistantsClient> assistantsClient;
protected final Supplier<PhoneNumbersClient> phoneNumbersClient;
protected final Supplier<SquadsClient> squadsClient;
protected final Supplier<KnowledgeBasesClient> knowledgeBasesClient;
protected final Supplier<BlocksClient> blocksClient;
protected final Supplier<ToolsClient> toolsClient;
protected final Supplier<FilesClient> filesClient;
protected final Supplier<AnalyticsClient> analyticsClient;
protected final Supplier<LogsClient> 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();
}
}