Skip to content

Commit e5e97a5

Browse files
SDK regeneration
1 parent a665131 commit e5e97a5

46 files changed

Lines changed: 135 additions & 133 deletions

Some content is hidden

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

.fern/metadata.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"generatorVersion": "4.0.4",
55
"generatorConfig": {
66
"package-prefix": "com.deepgram",
7+
"base-api-exception-class-name": "DeepgramHttpException",
8+
"enable-forward-compatible-enums": true,
79
"client": {
810
"class-name": "DeepgramClient"
911
},
1012
"enable-wire-tests": true
1113
},
12-
"originGitCommit": "78fd4d4c60752a78daaa68b3d58da0554c9ce481",
13-
"sdkVersion": "0.1.0"
14+
"originGitCommit": "e994b5ab79ae6fe3560daff055acdf80d315b48e",
15+
"sdkVersion": "0.1.1"
1416
}

src/main/java/com/deepgram/core/ClientOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ private ClientOptions(
4141
this.headers.putAll(headers);
4242
this.headers.putAll(new HashMap<String, String>() {
4343
{
44-
put("User-Agent", "com.deepgram:deepgram-java-sdk/0.1.0");
44+
put("User-Agent", "com.deepgram:deepgram-sdk/0.1.1");
4545
put("X-Fern-Language", "JAVA");
46-
put("X-Fern-SDK-Name", "com.deepgram:deepgram-java-sdk");
47-
put("X-Fern-SDK-Version", "0.1.0");
46+
put("X-Fern-SDK-Name", "com.deepgram.fern:api-sdk");
47+
put("X-Fern-SDK-Version", "0.1.1");
4848
}
4949
});
5050
this.headerSuppliers = headerSuppliers;

src/main/java/com/deepgram/core/DeepgramApiApiException.java renamed to src/main/java/com/deepgram/core/DeepgramHttpException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/**
1313
* This exception type will be thrown for any non-2XX API responses.
1414
*/
15-
public class DeepgramApiApiException extends DeepgramApiException {
15+
public class DeepgramHttpException extends DeepgramApiException {
1616
/**
1717
* The error code of the response that triggered the exception.
1818
*/
@@ -25,14 +25,14 @@ public class DeepgramApiApiException extends DeepgramApiException {
2525

2626
private final Map<String, List<String>> headers;
2727

28-
public DeepgramApiApiException(String message, int statusCode, Object body) {
28+
public DeepgramHttpException(String message, int statusCode, Object body) {
2929
super(message);
3030
this.statusCode = statusCode;
3131
this.body = body;
3232
this.headers = new HashMap<>();
3333
}
3434

35-
public DeepgramApiApiException(String message, int statusCode, Object body, Response rawResponse) {
35+
public DeepgramHttpException(String message, int statusCode, Object body, Response rawResponse) {
3636
super(message);
3737
this.statusCode = statusCode;
3838
this.body = body;
@@ -67,7 +67,7 @@ public Map<String, List<String>> headers() {
6767

6868
@Override
6969
public String toString() {
70-
return "DeepgramApiApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: "
70+
return "DeepgramHttpException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: "
7171
+ ObjectMappers.stringify(body) + "}";
7272
}
7373
}

src/main/java/com/deepgram/errors/BadRequestError.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
*/
44
package com.deepgram.errors;
55

6-
import com.deepgram.core.DeepgramApiApiException;
6+
import com.deepgram.core.DeepgramHttpException;
77
import okhttp3.Response;
88

9-
public final class BadRequestError extends DeepgramApiApiException {
9+
public final class BadRequestError extends DeepgramHttpException {
1010
/**
1111
* The body of the response that triggered the exception.
1212
*/

src/main/java/com/deepgram/resources/agent/v1/settings/think/models/AsyncRawModelsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package com.deepgram.resources.agent.v1.settings.think.models;
55

66
import com.deepgram.core.ClientOptions;
7-
import com.deepgram.core.DeepgramApiApiException;
87
import com.deepgram.core.DeepgramApiException;
98
import com.deepgram.core.DeepgramApiHttpResponse;
9+
import com.deepgram.core.DeepgramHttpException;
1010
import com.deepgram.core.ObjectMappers;
1111
import com.deepgram.core.RequestOptions;
1212
import com.deepgram.errors.BadRequestError;
@@ -83,7 +83,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
8383
// unable to map error response, throwing generic error
8484
}
8585
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
86-
future.completeExceptionally(new DeepgramApiApiException(
86+
future.completeExceptionally(new DeepgramHttpException(
8787
"Error with status code " + response.code(), response.code(), errorBody, response));
8888
return;
8989
} catch (IOException e) {

src/main/java/com/deepgram/resources/agent/v1/settings/think/models/RawModelsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package com.deepgram.resources.agent.v1.settings.think.models;
55

66
import com.deepgram.core.ClientOptions;
7-
import com.deepgram.core.DeepgramApiApiException;
87
import com.deepgram.core.DeepgramApiException;
98
import com.deepgram.core.DeepgramApiHttpResponse;
9+
import com.deepgram.core.DeepgramHttpException;
1010
import com.deepgram.core.ObjectMappers;
1111
import com.deepgram.core.RequestOptions;
1212
import com.deepgram.errors.BadRequestError;
@@ -73,7 +73,7 @@ public DeepgramApiHttpResponse<AgentThinkModelsV1Response> list(RequestOptions r
7373
// unable to map error response, throwing generic error
7474
}
7575
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
76-
throw new DeepgramApiApiException(
76+
throw new DeepgramHttpException(
7777
"Error with status code " + response.code(), response.code(), errorBody, response);
7878
} catch (IOException e) {
7979
throw new DeepgramApiException("Network error executing HTTP request", e);

src/main/java/com/deepgram/resources/auth/v1/tokens/AsyncRawTokensClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package com.deepgram.resources.auth.v1.tokens;
55

66
import com.deepgram.core.ClientOptions;
7-
import com.deepgram.core.DeepgramApiApiException;
87
import com.deepgram.core.DeepgramApiException;
98
import com.deepgram.core.DeepgramApiHttpResponse;
9+
import com.deepgram.core.DeepgramHttpException;
1010
import com.deepgram.core.MediaTypes;
1111
import com.deepgram.core.ObjectMappers;
1212
import com.deepgram.core.RequestOptions;
@@ -108,7 +108,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
108108
// unable to map error response, throwing generic error
109109
}
110110
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
111-
future.completeExceptionally(new DeepgramApiApiException(
111+
future.completeExceptionally(new DeepgramHttpException(
112112
"Error with status code " + response.code(), response.code(), errorBody, response));
113113
return;
114114
} catch (IOException e) {

src/main/java/com/deepgram/resources/auth/v1/tokens/RawTokensClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package com.deepgram.resources.auth.v1.tokens;
55

66
import com.deepgram.core.ClientOptions;
7-
import com.deepgram.core.DeepgramApiApiException;
87
import com.deepgram.core.DeepgramApiException;
98
import com.deepgram.core.DeepgramApiHttpResponse;
9+
import com.deepgram.core.DeepgramHttpException;
1010
import com.deepgram.core.MediaTypes;
1111
import com.deepgram.core.ObjectMappers;
1212
import com.deepgram.core.RequestOptions;
@@ -97,7 +97,7 @@ public DeepgramApiHttpResponse<GrantV1Response> grant(GrantV1Request request, Re
9797
// unable to map error response, throwing generic error
9898
}
9999
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
100-
throw new DeepgramApiApiException(
100+
throw new DeepgramHttpException(
101101
"Error with status code " + response.code(), response.code(), errorBody, response);
102102
} catch (IOException e) {
103103
throw new DeepgramApiException("Network error executing HTTP request", e);

src/main/java/com/deepgram/resources/listen/v1/media/AsyncRawMediaClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package com.deepgram.resources.listen.v1.media;
55

66
import com.deepgram.core.ClientOptions;
7-
import com.deepgram.core.DeepgramApiApiException;
87
import com.deepgram.core.DeepgramApiException;
98
import com.deepgram.core.DeepgramApiHttpResponse;
9+
import com.deepgram.core.DeepgramHttpException;
1010
import com.deepgram.core.InputStreamRequestBody;
1111
import com.deepgram.core.MediaTypes;
1212
import com.deepgram.core.ObjectMappers;
@@ -243,7 +243,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
243243
// unable to map error response, throwing generic error
244244
}
245245
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
246-
future.completeExceptionally(new DeepgramApiApiException(
246+
future.completeExceptionally(new DeepgramHttpException(
247247
"Error with status code " + response.code(), response.code(), errorBody, response));
248248
return;
249249
} catch (IOException e) {
@@ -475,7 +475,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
475475
// unable to map error response, throwing generic error
476476
}
477477
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
478-
future.completeExceptionally(new DeepgramApiApiException(
478+
future.completeExceptionally(new DeepgramHttpException(
479479
"Error with status code " + response.code(), response.code(), errorBody, response));
480480
return;
481481
} catch (IOException e) {

src/main/java/com/deepgram/resources/listen/v1/media/RawMediaClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package com.deepgram.resources.listen.v1.media;
55

66
import com.deepgram.core.ClientOptions;
7-
import com.deepgram.core.DeepgramApiApiException;
87
import com.deepgram.core.DeepgramApiException;
98
import com.deepgram.core.DeepgramApiHttpResponse;
9+
import com.deepgram.core.DeepgramHttpException;
1010
import com.deepgram.core.InputStreamRequestBody;
1111
import com.deepgram.core.MediaTypes;
1212
import com.deepgram.core.ObjectMappers;
@@ -233,7 +233,7 @@ public DeepgramApiHttpResponse<MediaTranscribeResponse> transcribeUrl(
233233
// unable to map error response, throwing generic error
234234
}
235235
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
236-
throw new DeepgramApiApiException(
236+
throw new DeepgramHttpException(
237237
"Error with status code " + response.code(), response.code(), errorBody, response);
238238
} catch (IOException e) {
239239
throw new DeepgramApiException("Network error executing HTTP request", e);
@@ -449,7 +449,7 @@ public DeepgramApiHttpResponse<MediaTranscribeResponse> transcribeFile(
449449
// unable to map error response, throwing generic error
450450
}
451451
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
452-
throw new DeepgramApiApiException(
452+
throw new DeepgramHttpException(
453453
"Error with status code " + response.code(), response.code(), errorBody, response);
454454
} catch (IOException e) {
455455
throw new DeepgramApiException("Network error executing HTTP request", e);

0 commit comments

Comments
 (0)