Skip to content

Commit af2bd58

Browse files
committed
Release 0.3.0
1 parent 0df2769 commit af2bd58

File tree

227 files changed

+26868
-5054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+26868
-5054
lines changed

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ java {
4444

4545
group = 'dev.vapi'
4646

47-
version = '0.2.0'
47+
version = '0.3.0'
4848

4949
jar {
5050
dependsOn(":generatePomFileForMavenPublication")
@@ -71,7 +71,7 @@ publishing {
7171
maven(MavenPublication) {
7272
groupId = 'dev.vapi'
7373
artifactId = 'server-sdk'
74-
version = '0.2.0'
74+
version = '0.3.0'
7575
from components.java
7676
pom {
7777
licenses {

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+1-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ done
8686
# shellcheck disable=SC2034
8787
APP_BASE_NAME=${0##*/}
8888
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90-
' "$PWD" ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
9190

9291
# Use the maximum available, or set MAX_FD != -1 to use that value.
9392
MAX_FD=maximum

src/main/java/com/vapi/api/VapiBuilder.java

+8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ public VapiBuilder url(String url) {
3131
return this;
3232
}
3333

34+
/**
35+
* Sets the timeout (in seconds) for the client
36+
*/
37+
public VapiBuilder timeout(int timeout) {
38+
this.clientOptionsBuilder.timeout(timeout);
39+
return this;
40+
}
41+
3442
public Vapi build() {
3543
this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + this.token);
3644
clientOptionsBuilder.environment(this.environment);

src/main/java/com/vapi/api/core/ClientOptions.java

+18-3
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,27 @@ public final class ClientOptions {
1818

1919
private final OkHttpClient httpClient;
2020

21+
private final int timeout;
22+
2123
private ClientOptions(
2224
Environment environment,
2325
Map<String, String> headers,
2426
Map<String, Supplier<String>> headerSuppliers,
25-
OkHttpClient httpClient) {
27+
OkHttpClient httpClient,
28+
int timeout) {
2629
this.environment = environment;
2730
this.headers = new HashMap<>();
2831
this.headers.putAll(headers);
2932
this.headers.putAll(new HashMap<String, String>() {
3033
{
3134
put("X-Fern-Language", "JAVA");
3235
put("X-Fern-SDK-Name", "com.vapi.fern:api-sdk");
33-
put("X-Fern-SDK-Version", "0.2.0");
36+
put("X-Fern-SDK-Version", "0.3.0");
3437
}
3538
});
3639
this.headerSuppliers = headerSuppliers;
3740
this.httpClient = httpClient;
41+
this.timeout = timeout;
3842
}
3943

4044
public Environment environment() {
@@ -80,6 +84,8 @@ public static final class Builder {
8084

8185
private final Map<String, Supplier<String>> headerSuppliers = new HashMap<>();
8286

87+
private int timeout = 60;
88+
8389
public Builder environment(Environment environment) {
8490
this.environment = environment;
8591
return this;
@@ -95,11 +101,20 @@ public Builder addHeader(String key, Supplier<String> value) {
95101
return this;
96102
}
97103

104+
/**
105+
* Override the timeout in seconds. Defaults to 60 seconds.
106+
*/
107+
public Builder timeout(int timeout) {
108+
this.timeout = timeout;
109+
return this;
110+
}
111+
98112
public ClientOptions build() {
99113
OkHttpClient okhttpClient = new OkHttpClient.Builder()
100114
.addInterceptor(new RetryInterceptor(3))
115+
.callTimeout(this.timeout, TimeUnit.SECONDS)
101116
.build();
102-
return new ClientOptions(environment, headers, headerSuppliers, okhttpClient);
117+
return new ClientOptions(environment, headers, headerSuppliers, okhttpClient, this.timeout);
103118
}
104119
}
105120
}

src/main/java/com/vapi/api/resources/assistants/AssistantsClient.java

-4
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,6 @@ public Assistant delete(String id, RequestOptions requestOptions) {
220220
}
221221
}
222222

223-
public Assistant update(String id) {
224-
return update(id, UpdateAssistantDto.builder().build());
225-
}
226-
227223
public Assistant update(String id, UpdateAssistantDto request) {
228224
return update(id, request, null);
229225
}

src/main/java/com/vapi/api/resources/assistants/requests/UpdateAssistantDto.java

+30
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.vapi.api.core.ObjectMappers;
1515
import com.vapi.api.resources.assistants.types.UpdateAssistantDtoBackgroundSound;
1616
import com.vapi.api.resources.assistants.types.UpdateAssistantDtoClientMessagesItem;
17+
import com.vapi.api.resources.assistants.types.UpdateAssistantDtoCredentialsItem;
1718
import com.vapi.api.resources.assistants.types.UpdateAssistantDtoFirstMessageMode;
1819
import com.vapi.api.resources.assistants.types.UpdateAssistantDtoModel;
1920
import com.vapi.api.resources.assistants.types.UpdateAssistantDtoServerMessagesItem;
@@ -65,6 +66,8 @@ public final class UpdateAssistantDto {
6566

6667
private final Optional<List<TransportConfigurationTwilio>> transportConfigurations;
6768

69+
private final Optional<List<UpdateAssistantDtoCredentialsItem>> credentials;
70+
6871
private final Optional<String> name;
6972

7073
private final Optional<TwilioVoicemailDetection> voicemailDetection;
@@ -110,6 +113,7 @@ private UpdateAssistantDto(
110113
Optional<Boolean> backgroundDenoisingEnabled,
111114
Optional<Boolean> modelOutputInMessagesEnabled,
112115
Optional<List<TransportConfigurationTwilio>> transportConfigurations,
116+
Optional<List<UpdateAssistantDtoCredentialsItem>> credentials,
113117
Optional<String> name,
114118
Optional<TwilioVoicemailDetection> voicemailDetection,
115119
Optional<String> voicemailMessage,
@@ -139,6 +143,7 @@ private UpdateAssistantDto(
139143
this.backgroundDenoisingEnabled = backgroundDenoisingEnabled;
140144
this.modelOutputInMessagesEnabled = modelOutputInMessagesEnabled;
141145
this.transportConfigurations = transportConfigurations;
146+
this.credentials = credentials;
142147
this.name = name;
143148
this.voicemailDetection = voicemailDetection;
144149
this.voicemailMessage = voicemailMessage;
@@ -282,6 +287,14 @@ public Optional<List<TransportConfigurationTwilio>> getTransportConfigurations()
282287
return transportConfigurations;
283288
}
284289

290+
/**
291+
* @return These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.
292+
*/
293+
@JsonProperty("credentials")
294+
public Optional<List<UpdateAssistantDtoCredentialsItem>> getCredentials() {
295+
return credentials;
296+
}
297+
285298
/**
286299
* @return This is the name of the assistant.
287300
* <p>This is required when you want to transfer between assistants in a call.</p>
@@ -453,6 +466,7 @@ private boolean equalTo(UpdateAssistantDto other) {
453466
&& backgroundDenoisingEnabled.equals(other.backgroundDenoisingEnabled)
454467
&& modelOutputInMessagesEnabled.equals(other.modelOutputInMessagesEnabled)
455468
&& transportConfigurations.equals(other.transportConfigurations)
469+
&& credentials.equals(other.credentials)
456470
&& name.equals(other.name)
457471
&& voicemailDetection.equals(other.voicemailDetection)
458472
&& voicemailMessage.equals(other.voicemailMessage)
@@ -486,6 +500,7 @@ public int hashCode() {
486500
this.backgroundDenoisingEnabled,
487501
this.modelOutputInMessagesEnabled,
488502
this.transportConfigurations,
503+
this.credentials,
489504
this.name,
490505
this.voicemailDetection,
491506
this.voicemailMessage,
@@ -541,6 +556,8 @@ public static final class Builder {
541556

542557
private Optional<List<TransportConfigurationTwilio>> transportConfigurations = Optional.empty();
543558

559+
private Optional<List<UpdateAssistantDtoCredentialsItem>> credentials = Optional.empty();
560+
544561
private Optional<String> name = Optional.empty();
545562

546563
private Optional<TwilioVoicemailDetection> voicemailDetection = Optional.empty();
@@ -589,6 +606,7 @@ public Builder from(UpdateAssistantDto other) {
589606
backgroundDenoisingEnabled(other.getBackgroundDenoisingEnabled());
590607
modelOutputInMessagesEnabled(other.getModelOutputInMessagesEnabled());
591608
transportConfigurations(other.getTransportConfigurations());
609+
credentials(other.getCredentials());
592610
name(other.getName());
593611
voicemailDetection(other.getVoicemailDetection());
594612
voicemailMessage(other.getVoicemailMessage());
@@ -760,6 +778,17 @@ public Builder transportConfigurations(List<TransportConfigurationTwilio> transp
760778
return this;
761779
}
762780

781+
@JsonSetter(value = "credentials", nulls = Nulls.SKIP)
782+
public Builder credentials(Optional<List<UpdateAssistantDtoCredentialsItem>> credentials) {
783+
this.credentials = credentials;
784+
return this;
785+
}
786+
787+
public Builder credentials(List<UpdateAssistantDtoCredentialsItem> credentials) {
788+
this.credentials = Optional.ofNullable(credentials);
789+
return this;
790+
}
791+
763792
@JsonSetter(value = "name", nulls = Nulls.SKIP)
764793
public Builder name(Optional<String> name) {
765794
this.name = name;
@@ -930,6 +959,7 @@ public UpdateAssistantDto build() {
930959
backgroundDenoisingEnabled,
931960
modelOutputInMessagesEnabled,
932961
transportConfigurations,
962+
credentials,
933963
name,
934964
voicemailDetection,
935965
voicemailMessage,

0 commit comments

Comments
 (0)